Skip to content

Keep the bars docked to the window out of the navigation bar - #885

Open
JingMatrix wants to merge 1 commit into
masterfrom
fix-docked-bars-navigation-inset
Open

Keep the bars docked to the window out of the navigation bar#885
JingMatrix wants to merge 1 commit into
masterfrom
fix-docked-bars-navigation-inset

Conversation

@JingMatrix

Copy link
Copy Markdown
Owner

Scaffold places its bottom slot against the bottom of the window and reserves nothing for it — the documentation says topBar and bottomBar are expected to handle insets themselves, which is why NavigationBar and BottomAppBar carry windowInsets of their own. Three of the four docked bars here are plain Surfaces 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 NavigationSuiteScaffold consumes NoWindowInsets while 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: contentWindowInsets was 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.

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.
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.

1 participant