Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the Adaptive Layout Codelab edge-to-edge #485

Merged
merged 4 commits into from
Nov 7, 2024
Merged

Make the Adaptive Layout Codelab edge-to-edge #485

merged 4 commits into from
Nov 7, 2024

Conversation

ashnohe
Copy link
Contributor

@ashnohe ashnohe commented Aug 30, 2024

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 ashnohe requested a review from a team as a code owner August 30, 2024 00:01
@ashnohe ashnohe changed the title Add edge-to-edge for the Adaptive Layout Codelab Make the Adaptive Layout Codelab edge-to-edge Aug 30, 2024
Copy link
Contributor

@riggaroo riggaroo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Alex's comment should be addressed and then we good to merge!

@ashnohe ashnohe merged commit c33b618 into main Nov 7, 2024
1 check passed
@ashnohe ashnohe deleted the e2e_for_main branch November 7, 2024 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants