Skip to content

android: make the overlay bar actually overlay something (#1836) - #1838

Merged
ryanbr merged 2 commits into
mainfrom
fix/1836-overlay-actually-shows
Sep 3, 2026
Merged

ryanbr merged 2 commits into
mainfrom
fix/1836-overlay-actually-shows

Conversation

@ryanbr

@ryanbr ryanbr commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Follow-up to #1837, which shipped a toggle that changed nothing on screen. Reported straight away:
"I don't see a difference when I enabled bottom bar overlay." Correct, and the reason is a logic error of
mine.

Why the first version was inert

Moving the bar out of the Scaffold slot is not enough on its own. A screen's backdrop
(LiquidScreenSky / BackgroundImageBackdrop) is painted inside the screen, and the overlay path
still inset the NavHost by the bar height — so the screen, and its backdrop with it, stopped exactly
where it did before.

The bar floated over a strip of the shell's containerColor, not over anything. Hence: identical layout,
and a black band around the bar where the mosaic background should have continued.

I wrote the missing half in #1837's own description as a nice-to-have follow-up:

Content scrolling under the glass. That needs every scrollable to add the bar height to its own
contentPadding; no shared modifier can do it.

That was not a follow-up. It was the mechanism, and calling it optional is what let an inert change ship
behind a switch that promised something.

What this does

  • The screen reaches the bottom edge. The NavHost's bottom inset is zero in the overlay path, so a
    screen's full-bleed backdrop paints behind and around the glass.
  • ScreenScaffold clears the bar from the CONTENT. The bar's height is added to the scrolling column's
    bottom padding. Because that padding sits inside the scroll viewport, content passes under the bar as
    you scroll and the last row still comes to rest clear of it.

That distinction — layout reaches the edge, content clears the bar — is the whole overlay.

One change, not four

Every top-level screen routes through ScreenScaffold: Today, Trends, Sleep, Coupled and More. So none of
them needed touching, and a screen added later inherits it. Checked rather than assumed — Today's other
verticalScroll is a bounded editor list, not the page scroll.

The measured height rides on BottomBarStyleStore, mirroring BackgroundImageStore, and
barHeightForContent() returns zero unless the overlay is on — so a caller cannot inset content in the
slot layout, where the Scaffold has already reserved that space.

Unchanged

Still behind Settings → Appearance → Bottom bar overlay, default off. The off-path remains the shipped
slot layout.

Verification

compileFullDebugKotlin clean, full Android suite 5089 tests, 0 failures, doc-comment gate clean.

Still needs a device — but unlike the first version there is now something to look at: the background
should continue around and behind the bar, and content should pass beneath the glass while scrolling.

#1837 shipped a toggle that changed nothing on screen, and the reason was a
logic error I described as a follow-up instead of recognising as the
mechanism.

Moving the bar out of the Scaffold slot is not enough on its own. A screen's
backdrop is painted INSIDE the screen, and the overlay path still inset the
NavHost by the bar height — so the screen, and its backdrop with it, still
stopped exactly where it did before. The bar floated over a strip of the
shell's container colour rather than over anything, which is why enabling the
setting looked identical and left a black band around the bar.

The screen now reaches the bottom edge (NavHost bottom inset is zero in the
overlay path) so its full-bleed backdrop paints behind AND around the glass,
and ScreenScaffold adds the bar's height to the scrolling CONTENT's bottom
padding instead. Because that padding sits inside the scroll viewport, content
passes under the bar as you scroll and the last row still comes to rest clear
of it.

Doing it in ScreenScaffold is what makes this one change rather than four:
every top-level screen routes through it — Today, Trends, Sleep, Coupled and
More — so none needed touching. Today's other verticalScroll is a bounded
editor list, not the page.

The measured height rides on BottomBarStyleStore, mirroring
BackgroundImageStore, and barHeightForContent() returns zero unless the
overlay is on, so a caller cannot inset content in the slot layout where the
Scaffold has already reserved that space.

Kotlin: full suite 5089/0; compile and doc-comment gate clean. Still needs a
device — but unlike the first version there is now something to look at.
Re-review catch. Routing the inset through ScreenScaffold covers every
top-level screen, which is why it is one change rather than four — but it only
covers screens that USE it.

Auditing every screen that scrolls without it turned up eight files. Seven are
not NavHost destinations, or are sheets: UpdatesInboxScreen renders inside a
ModalBottomSheet, which is its own window above the bar. StepsCalibrationScreen
is the exception - a real destination, scrolling on its own Column.

In the overlay layout that screen reaches the bottom edge like any other, so
without clearance its last rows sit behind the bar. Zero when the overlay is
off, so the slot layout is untouched.

The comment there names the general rule, since the next screen added outside
ScreenScaffold will need the same and nothing enforces it.

Kotlin: full suite 5089/0; compile and doc-comment gate clean.
@ryanbr
ryanbr merged commit 0839ca9 into main Sep 3, 2026
4 checks passed
@ryanbr
ryanbr deleted the fix/1836-overlay-actually-shows branch September 3, 2026 03:16
ryanbr added a commit that referenced this pull request Sep 3, 2026
versionCode 420 -> 421, CURRENT_PROJECT_VERSION 301 -> 302. Version stays 11.1.1.

421 is the first build where the overlay bottom bar does anything. In 420 the toggle was inert - the
bar moved out of the Scaffold slot but the screen was still inset above it, so the backdrop stopped
where it always had. #1838 lets the screen reach the bottom edge and clears the bar from the scrolling
content instead.

Settings > Appearance > Bottom bar overlay, still default OFF. With it on, the background should
continue around and behind the bar and content should pass beneath the glass while scrolling.
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