fix: System bars contiuously showing on Android video player#568
Merged
PartyDonut merged 3 commits intoDonutWare:developfrom Nov 7, 2025
Merged
Conversation
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideImplements immersive system bars behavior on Android by setting transient swipe behavior in the Kotlin composable and standardizing the Flutter player controls to immersiveSticky mode. Sequence diagram for system bars behavior when returning from notification areasequenceDiagram
actor User
participant "VideoPlayerControls (Flutter)"
participant "ImmersiveSystemBars (Kotlin)"
participant "SystemChrome"
User->>"VideoPlayerControls (Flutter)": Open video player
"VideoPlayerControls (Flutter)"->>"ImmersiveSystemBars (Kotlin)": Request immersive system bars
"ImmersiveSystemBars (Kotlin)"->>"SystemChrome": Set system bars to immersiveSticky
User->>"VideoPlayerControls (Flutter)": Check notification area
"VideoPlayerControls (Flutter)"->>"ImmersiveSystemBars (Kotlin)": System bars reappear
"ImmersiveSystemBars (Kotlin)"->>"SystemChrome": Hide system bars with transient swipe behavior
User->>"VideoPlayerControls (Flutter)": Return to video player
"ImmersiveSystemBars (Kotlin)"->>"SystemChrome": System bars automatically hide
Class diagram for updated ImmersiveSystemBars composableclassDiagram
class ImmersiveSystemBars {
+ImmersiveSystemBars(isImmersive: Boolean)
}
class WindowInsetsControllerCompat {
+hide(type: WindowInsetsCompat.Type)
+show(type: WindowInsetsCompat.Type)
+systemBarsBehavior
}
ImmersiveSystemBars --> WindowInsetsControllerCompat
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey there - I've reviewed your changes - here's some feedback:
- Switch to DisposableEffect in ImmersiveSystemBars.kt to manage setup and cleanup of window insets behavior instead of using LaunchedEffect with an empty onDispose.
- In video_player_controls.dart, restore the previous SystemUiMode when the overlay is shown (rather than always setting immersiveSticky) to avoid unintended UI states.
- Guard the SystemChrome.setEnabledSystemUIMode call in video_player_controls.dart so it's only invoked when the UI mode actually changes, preventing redundant system calls.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Switch to DisposableEffect in ImmersiveSystemBars.kt to manage setup and cleanup of window insets behavior instead of using LaunchedEffect with an empty onDispose.
- In video_player_controls.dart, restore the previous SystemUiMode when the overlay is shown (rather than always setting immersiveSticky) to avoid unintended UI states.
- Guard the SystemChrome.setEnabledSystemUIMode call in video_player_controls.dart so it's only invoked when the UI mode actually changes, preventing redundant system calls.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
PartyDonut
approved these changes
Nov 7, 2025
Collaborator
There was a problem hiding this comment.
Thanks, looks good not sure I like the immersiveSticky more the leanbackMode. But looks like other video players use immersiveSticky as well. Let's see how I like it when using the application 😄 .
Also removed some small comments and fixed formatting. For future reference try to not use comments when the function or if statement is already clear.
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.
Pull Request Description
I noticed an issue on Android, specifically the mobile version, where when you are in the video player, you check the notification area and then go back out, the system bars stay there unless you press to show and hide the video player controls.
This PR fixes that so that the system bars get removed after that without needing to press anything else
Issue Being Fixed
System bars showing continuously after viewing notification area on Android
Screenshots / Recordings
Before:
Screen_Recording_20251102_120419.mp4
After:
Screen_Recording_20251102_120709.mp4
Checklist