Skip to content

Add support for statusBarHidden(:)#386

Draft
dfabulich wants to merge 1 commit intoskiptools:mainfrom
dfabulich:status-bar-hidden
Draft

Add support for statusBarHidden(:)#386
dfabulich wants to merge 1 commit intoskiptools:mainfrom
dfabulich:status-bar-hidden

Conversation

@dfabulich
Copy link
Copy Markdown
Contributor

@dfabulich dfabulich commented Apr 4, 2026

This one was surprisingly tricky. Partly because the default animation for hiding the status bar is mindbogglingly bad.

Here's how it looked with a naive hide/show implementation: a slow 1-second fade out, followed by a non-animated layout shift.

Screen_recording_20260403_191618.webm

And here's how it looks in this PR, with animations disabled. Much better, IMO.

Screen_recording_20260403_193033.webm

The other reason this was surprisingly tricky was that the API for disabling animations seems to be buggy. You have to ask for an animation controller with a callback from controlWindowInsetsAnimation , but if you make the call "too early" it simply doesn't work. There's a callback that you're supposed to wait for first, onControllableInsetsChanged, but that doesn't fire unless you've first waited for the view to be attached with View.OnAttachStateChangeListener, and even when it does fire, controlWindowInsetsAnimation still doesn't work that early.

The other reason it was surprisingly tricky was that the status bar automatically shows back up when the window loses focus (when you open the "recents"/"overview" app-switcher screen with the square button on the emulator). When that happens, the animation controller is cancelled, and you have to request a new one. SystemOverlays.swift is 70 lines of extremely hard-earned code.

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.

@dfabulich
Copy link
Copy Markdown
Contributor Author

Found a bug…

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.

1 participant