Skip to content

fix: System bars contiuously showing on Android video player#568

Merged
PartyDonut merged 3 commits intoDonutWare:developfrom
schembriaiden:android-fix-top-bottom-bars
Nov 7, 2025
Merged

fix: System bars contiuously showing on Android video player#568
PartyDonut merged 3 commits intoDonutWare:developfrom
schembriaiden:android-fix-top-bottom-bars

Conversation

@schembriaiden
Copy link
Copy Markdown
Contributor

@schembriaiden schembriaiden commented Nov 2, 2025

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

  • If a new package was added, did you ensure it works for all supported platforms? Is the package well maintained
  • Check that any changes are related to the issue at hand.

@schembriaiden schembriaiden changed the title fix: System bars conitnuously showing on Android video player fix: System bars contiuously showing on Android video player Nov 2, 2025
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Nov 2, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Implements 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 area

sequenceDiagram
    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
Loading

Class diagram for updated ImmersiveSystemBars composable

classDiagram
    class ImmersiveSystemBars {
        +ImmersiveSystemBars(isImmersive: Boolean)
    }
    class WindowInsetsControllerCompat {
        +hide(type: WindowInsetsCompat.Type)
        +show(type: WindowInsetsCompat.Type)
        +systemBarsBehavior
    }
    ImmersiveSystemBars --> WindowInsetsControllerCompat
Loading

File-Level Changes

Change Details Files
Enable transient system bars behavior after hiding them in the Android composable
  • Set systemBarsBehavior to BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE after hiding
  • Adjusted formatting within LaunchedEffect block
android/app/src/main/kotlin/nl/jknaapen/fladder/utility/ImmersiveSystemBars.kt
Standardize Flutter video player UI mode to immersiveSticky
  • Replaced conditional edgeToEdge/leanBack logic with SystemUiMode.immersiveSticky
  • Removed custom overlays argument
lib/screens/video_player/video_player_controls.dart

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
Collaborator

@PartyDonut PartyDonut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@PartyDonut PartyDonut added the bug Something isn't working label Nov 7, 2025
@PartyDonut PartyDonut merged commit b9c1e82 into DonutWare:develop Nov 7, 2025
2 checks passed
@github-project-automation github-project-automation bot moved this to Done in Fladder Nov 7, 2025
@schembriaiden schembriaiden deleted the android-fix-top-bottom-bars branch January 21, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants