codelab-android-compose
codelab-android-compose copied to clipboard
Make the Adaptive Layout Codelab edge-to-edge
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
ReplyListPaneandReplyDetailPane. To do this, I setcontentPadding=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)withpadding(horizontal = 16.dp).
These changes are made to the main branch.
Portrait:
Landscape (looks a little weird, not yet sure what to do about this):
Unfolded, showing the last list item:
When this commit is cherry picked to the end branch the app will look like this: