]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/commitdiff
Fix hiding the navigation bar in full screen browsing for API <= 29. https://redmine...
authorSoren Stoutner <soren@stoutner.com>
Thu, 26 Feb 2026 22:49:22 +0000 (15:49 -0700)
committerSoren Stoutner <soren@stoutner.com>
Thu, 26 Feb 2026 22:49:22 +0000 (15:49 -0700)
app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.kt

index b31b75d263938a62906998fdaa8ca3f5e1a6fede..bee5fd2bcc193f32c3fc2c892d34b860c3834c9e 100644 (file)
@@ -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
                         }
                     }