Skip to content

Support edge to edge in widget configure activities #5352

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

Merged
merged 5 commits into from
May 27, 2025

Conversation

TimoPtr
Copy link
Collaborator

@TimoPtr TimoPtr commented May 23, 2025

Summary

In order to tackle part of #5328, this PR enable support for edge to edge in all the configure widget screens.

Checklist

  • New or updated tests have been added to cover the changes following the testing guidelines.
  • The code follows the project's code style and best_practices.
  • The changes have been thoroughly tested, and edge cases have been considered.
  • Changes are backward compatible whenever feasible. Any breaking changes are documented in the changelog for users and/or in the code for developers depending on the relevance.

@jpelgrom
Copy link
Member

I might be picky, but the design here isn't really what I expected from edge to edge. The navigation bar isn't transparent (note the button getting cut off) and in the XML activities, the Toolbar scrolls with the page content (not new, but this might be the time to fix it).

Landscape screenshot of widget configuration with a blue button at the bottom half cut off, white bar on top of the bottom half
Bottom of toolbar title text visible on scrolled down landscape screenshot

(using landscape with larger font size as a quick test, but can also happen in portrait on smaller screens or if configuration appears after selecting an entity pushing items down)

@TimoPtr
Copy link
Collaborator Author

TimoPtr commented May 27, 2025

image
Should be ok now

Comment on lines +24 to +42
@Composable
fun safeBottomWindowInsets(): WindowInsets {
return WindowInsets.safeDrawing.only(WindowInsetsSides.Bottom + WindowInsetsSides.Horizontal)
}

@Composable
fun safeBottomPaddingValues(): PaddingValues {
return safeBottomWindowInsets().asPaddingValues()
}

@Composable
fun safeTopWindowInsets(): WindowInsets {
return WindowInsets.safeDrawing.only(WindowInsetsSides.Top + WindowInsetsSides.Horizontal)
}

@Composable
fun safeTopPaddingValues(): PaddingValues {
return safeTopWindowInsets().asPaddingValues()
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@jpelgrom I think I should double check in settings screen the insets because I didn't handle the case of cutout corner like you've said in barcode PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

After a quick look it's seems to be ok for SettingsActivity since I apply the safeDrawing except at the bottom and that's enough.

@TimoPtr TimoPtr merged commit fd70ddf into main May 27, 2025
17 checks passed
@TimoPtr TimoPtr deleted the feature/edge-to-edge-configure-widget branch May 27, 2025 13:52
@TimoPtr
Copy link
Collaborator Author

TimoPtr commented May 27, 2025

Merged if any issue arise I will tackle it in another PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants