From: Soren Stoutner Date: Thu, 26 Feb 2026 22:49:22 +0000 (-0700) Subject: Fix hiding the navigation bar in full screen browsing for API <= 29. https://redmine... X-Git-Url: https://gitweb.stoutner.com/?a=commitdiff_plain;h=ed4857a80276044fc93343adfd4d0ad06cdad8de;p=PrivacyBrowserAndroid.git Fix hiding the navigation bar in full screen browsing for API <= 29. https://redmine.stoutner.com/issues/1288 --- diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.kt b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.kt index b31b75d2..bee5fd2b 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.kt @@ -911,7 +911,7 @@ class MainWebViewActivity : AppCompatActivity(), CreateBookmarkDialog.CreateBook */ @Suppress("DEPRECATION") - browserFrameLayout.systemUiVisibility = View.SYSTEM_UI_FLAG_FULLSCREEN or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY + browserFrameLayout.systemUiVisibility = (View.SYSTEM_UI_FLAG_FULLSCREEN or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) } // Show any pending dialogs. @@ -4863,7 +4863,7 @@ class MainWebViewActivity : AppCompatActivity(), CreateBookmarkDialog.CreateBook */ @Suppress("DEPRECATION") - window.addFlags(View.SYSTEM_UI_FLAG_FULLSCREEN or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) + browserFrameLayout.systemUiVisibility = (View.SYSTEM_UI_FLAG_FULLSCREEN or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) } // Disable fits system windows according to the configuration. @@ -4948,7 +4948,7 @@ class MainWebViewActivity : AppCompatActivity(), CreateBookmarkDialog.CreateBook // Show the system bars. windowInsetsController.show(WindowInsets.Type.systemBars()) } else { - /* Show the system bars. + /* Show the system bars by resetting the UI visibility to 0, which removes the following flags. * SYSTEM_UI_FLAG_FULLSCREEN hides the status bar at the top of the screen. * SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN makes the root frame layout fill the area that is normally reserved for the status bar. * SYSTEM_UI_FLAG_HIDE_NAVIGATION hides the navigation bar on the bottom or right of the screen. @@ -4956,7 +4956,7 @@ class MainWebViewActivity : AppCompatActivity(), CreateBookmarkDialog.CreateBook */ @Suppress("DEPRECATION") - window.clearFlags(View.SYSTEM_UI_FLAG_FULLSCREEN or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) + browserFrameLayout.systemUiVisibility = 0 } }