Skip to content

Fix fullscreen video status bar not hiding on modern Android devices#7825

Open
brunovsiqueira wants to merge 1 commit intoduckduckgo:developfrom
brunovsiqueira:fix/6845-fullscreen-video-status-bar
Open

Fix fullscreen video status bar not hiding on modern Android devices#7825
brunovsiqueira wants to merge 1 commit intoduckduckgo:developfrom
brunovsiqueira:fix/6845-fullscreen-video-status-bar

Conversation

@brunovsiqueira
Copy link

@brunovsiqueira brunovsiqueira commented Feb 27, 2026

Task/Issue URL: #6845

Description

This PR fixes an issue where the system status bar doesn't fully hide during fullscreen video playback on certain devices (reported on Xiaomi Pad 7 Pro with HyperOS 2.0). The status bar content would disappear but the bar itself remained visible.

Root Cause: The existing implementation uses deprecated systemUiVisibility flags which don't work correctly on modern Android versions (11+) with custom OEM skins.

Solution:

  • Use WindowInsetsController API (Android 11+) for hiding system bars
  • Maintain backward compatibility with deprecated flags for Android 10 and below
  • Add display cutout handling for notched devices (API 28+)

Key Changes:

Change Purpose
WindowInsetsController.hide() Modern API for hiding system bars (API 30+)
BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE Allows temporary reveal on swipe, auto-hides
setDecorFitsSystemWindows(false) Content extends behind system bars
LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES True fullscreen on notched devices

Steps to test this PR

Fullscreen Video

  • Open the DuckDuckGo browser and navigate to a website with video (e.g., youtube.com)
  • Play a video and tap the fullscreen button
  • Verify that both status bar AND navigation bar completely disappear
  • Swipe from top/bottom edge - bars should appear temporarily then auto-hide
  • Exit fullscreen - bars should return to normal

Backward Compatibility

  • Test on Android 10 or below device/emulator if available
  • Verify fullscreen still works on older API levels

UI changes

Before After
Status bar content hidden but bar visible Status bar completely hidden

Note

Medium Risk
Updates fullscreen/immersive handling and state tracking at the base DuckDuckGoActivity level, which can affect system bar visibility and layout across activities, especially with OEM-specific behavior and API-version branching.

Overview
Fixes fullscreen video system bars not fully hiding on Android 11+ by reworking DuckDuckGoActivity.toggleFullScreen() to enter/exit immersive mode via WindowInsetsController (with legacy systemUiVisibility flags for older APIs) and adding display cutout handling.

Removes the FragmentActivity.isFullScreen/isImmersiveModeEnabled extensions and updates browser code paths (BrowserActivity, BrowserTabFragment, and JS orientation lock checks) to rely on the activity’s internally tracked isFullScreenMode() state to avoid async insets timing issues.

Written by Cursor Bugbot for commit 82d24ca. This will update automatically on new commits. Configure here.

@brunovsiqueira brunovsiqueira force-pushed the fix/6845-fullscreen-video-status-bar branch from 88acb36 to 28b2c8d Compare February 27, 2026 16:37
@brunovsiqueira brunovsiqueira force-pushed the fix/6845-fullscreen-video-status-bar branch from 28b2c8d to 4ab5819 Compare February 27, 2026 20:03
@brunovsiqueira brunovsiqueira force-pushed the fix/6845-fullscreen-video-status-bar branch from 4ab5819 to dd2e605 Compare February 27, 2026 20:26
@brunovsiqueira brunovsiqueira force-pushed the fix/6845-fullscreen-video-status-bar branch from dd2e605 to cca6bc0 Compare February 27, 2026 21:47
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Use WindowInsetsController API (Android 11+) instead of deprecated
systemUiVisibility flags for hiding system bars during fullscreen video.
This fixes issues on devices with custom OEM skins where the status bar
content would disappear but the bar itself remained visible.

Track fullscreen state internally with isInFullScreenMode boolean because
WindowInsetsController updates are asynchronous on API 30+. This ensures
callers get the correct state immediately after toggling, preventing
BrowserTabFragment.renderFullscreenMode() from incorrectly toggling
fullscreen off due to stale insets state.
@brunovsiqueira brunovsiqueira force-pushed the fix/6845-fullscreen-video-status-bar branch from cca6bc0 to 82d24ca Compare February 27, 2026 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant