codelab-android-compose icon indicating copy to clipboard operation
codelab-android-compose copied to clipboard

Make the Adaptive Layout Codelab edge-to-edge

Open ashnohe opened this issue 1 year ago • 0 comments

MainActivity.kt

  • Called enableEdgeToEdge()
  • Removed translucency applied to 3-button navigation bar with isNavigationBarContrastEnforced=false

Theme.kt

  • Removed all logic needed to set the status bar icon colors. Tested in both light & dark theme.

ReplyListContent.kt

  • Added a new function to make a copy of PaddingValues. Used in the next bullet.
  • Ensured first and last list items do not hide behind status bars, items scroll under the status bars, and excess bottom padding is removed in ReplyListPane and ReplyDetailPane. To do this, I set contentPadding = WindowInsets.safeDrawing.asPaddingValues().copy(layoutDirection, bottom = 0.dp).
  • Now that we're accounting for the top system bars, removed excess top padding by replacing padding(16.dp) with padding(horizontal = 16.dp).

These changes are made to the main branch.

Portrait: Screenshot_20240829-155943

Landscape (looks a little weird, not yet sure what to do about this): Screenshot_20240829-160014

Unfolded, showing the last list item: Screenshot_20240829-162448

When this commit is cherry picked to the end branch the app will look like this: Screenshot_20240829-163202

ashnohe avatar Aug 30 '24 00:08 ashnohe