cla-bot · GitHub

Screen_recording_20260429_122620.webm

This PR replaces PR #386. I jumped through a ton of hoops trying to get that to work, but it turned out that all I needed was a magic flag, WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE.

Option for setSystemBarsBehavior: Window would like to remain interactive when hiding navigation bars by calling hide or setInsetsAndAlpha.

When system bars are hidden in this mode, they can be revealed temporarily with system gestures, such as swiping from the edge of the screen where the bar is hidden from. These transient system bars will overlay app’s content, may have some degree of transparency, and will automatically hide after a short timeout.

Without this flag, the status bar takes a full second to fade away, and then the window insets change suddenly, creating a jarring layout shift. With this flag, the status bar animates away in 0.5s, and the inset animates with it. The flag also creates this effect where if you swipe down from the top of the screen, the status bar reappears. That seems fine to me.

They also offer a callback to use when it's time to re-hide the status bar, which we're using.

Skip Pull Request Checklist:


  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes.

Cursor did a first draft, which I cleaned up. I manually tested in the Showcase Lite app.

Read the original on github.com ↗