Draft
Conversation
This was referenced Apr 4, 2026
Contributor
Author
|
Found a bug… |
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.
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 withView.OnAttachStateChangeListener, and even when it does fire,controlWindowInsetsAnimationstill 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.swiftis 70 lines of extremely hard-earned code.Skip Pull Request Checklist:
swift testAdd support for
statusBarHidden(:)skip-fuse-ui#97Status bar hiding skipapp-showcase#86
Status bar hiding skipapp-showcase-fuse#56