Keep the bars docked to the window out of the navigation bar - #885
Open
JingMatrix wants to merge 1 commit into
Open
Keep the bars docked to the window out of the navigation bar#885JingMatrix wants to merge 1 commit into
JingMatrix wants to merge 1 commit into
Conversation
Scaffold places its bottom slot against the bottom of the window and reserves nothing for it -- the documentation is explicit that topBar and bottomBar are expected to handle insets themselves, which is why NavigationBar and BottomAppBar carry windowInsets of their own. Three of this app's four docked bars are plain Surfaces and reserved nothing, so their contents were drawn under the navigation bar. It bites on every detail screen whatever the navigation style, because the navigation container is hidden away from a panel root and NavigationSuiteScaffold consumes NoWindowInsets while hidden: nothing above the screen has taken the system bars. With three-button navigation that is 48dp, and on the scope editor it left a few pixels of Apply and Discard to aim at, which is #884. Gesture navigation is 24dp and was covered too, the handle drawn across the supporting line. The padding goes inside each bar's Surface rather than on it, so the fill still reaches the bottom edge and the bar reads as one surface. Insets already consumed count for nothing, so the same call adds nothing in the arrangements where a container below has taken them. Home is the same fault from the other direction. It sets contentWindowInsets to zero so the header can run under the status bar, which gave away the bottom as well; with the panels floating there is no container to have taken it, and both the last row of the feed and the scroll controls ended up behind the navigation bar. Take the bottom edge alone, from the Scaffold's own default so a bottom display cutout counts. Verified on a Pixel 6 (Android 17) under both navigation styles. With three buttons the bar occupies 2274 to 2400: Apply now ends at 2212 and the scroll controls at 2217. The eleven ModalBottomSheets need nothing -- none overrides contentWindowInsets and the default already covers the bottom edge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scaffoldplaces its bottom slot against the bottom of the window and reserves nothing for it — the documentation saystopBarandbottomBarare expected to handle insets themselves, which is whyNavigationBarandBottomAppBarcarrywindowInsetsof their own. Three of the four docked bars here are plainSurfaces and reserved nothing: the scope editor's apply bar, the tracker button, the flash bar.RepoDetailsScreen's install bar already did it and is the pattern they follow.It bites on every detail screen whatever the navigation style, because the container is hidden away from a panel root and
NavigationSuiteScaffoldconsumesNoWindowInsetswhile hidden. Three-button navigation is 48dp, which left a few pixels of Apply and Discard to aim at (#884); gesture navigation is 24dp and was covered too.The padding sits inside each
Surface, so the fill still reaches the bottom edge.Home is the same fault inverted:
contentWindowInsetswas zero so the header could run under the status bar, which gave away the bottom as well. It now takes the bottom edge alone.Verified on a Pixel 6 (Android 17) under both styles. The eleven
ModalBottomSheets need nothing.