Bug 1391160 - Remember SYSTEM_UI_FLAG_LIGHT_STATUS_BAR when show/hide fullscreen. r?nechen,sebastian,walkingice draft
authorJing-wei Wu <topwu.tw@gmail.com>
Mon, 28 Aug 2017 15:37:59 +0800
changeset 653987 837954a7e44920ec9509e9b91c87904ca3333e55
parent 653986 81cee081f20773d1e4a0a966180812178a6c6067
child 728459 07eecafde95ec6d2b3869346387a026a8f8a751b
push id76459
push userbmo:topwu.tw@gmail.com
push dateMon, 28 Aug 2017 07:44:20 +0000
reviewersnechen, sebastian, walkingice
bugs1391160
milestone57.0a1
Bug 1391160 - Remember SYSTEM_UI_FLAG_LIGHT_STATUS_BAR when show/hide fullscreen. r?nechen,sebastian,walkingice Keep the value of SYSTEM_UI_FLAG_LIGHT_STATUS_BAR in window system ui status when show/hide fullscreen. MozReview-Commit-ID: LHjEQKAPxYn
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ActivityUtils.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ActivityUtils.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ActivityUtils.java
@@ -31,29 +31,27 @@ public class ActivityUtils {
                 newVis |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
                         View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
                         View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
                         View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
                         View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
             } else {
                 newVis |= View.SYSTEM_UI_FLAG_LOW_PROFILE;
             }
-
-            if (AppConstants.Versions.feature23Plus) {
-                // We also have to set SYSTEM_UI_FLAG_LIGHT_STATUS_BAR with to current system ui status
-                // to support both light and dark status bar.
-                final int oldVis = window.getDecorView().getSystemUiVisibility();
-                newVis |= (oldVis & View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
-            }
-
-            window.getDecorView().setSystemUiVisibility(newVis);
         } else {
             newVis = View.SYSTEM_UI_FLAG_VISIBLE;
         }
 
+        if (AppConstants.Versions.feature23Plus) {
+            // We also have to set SYSTEM_UI_FLAG_LIGHT_STATUS_BAR with to current system ui status
+            // to support both light and dark status bar.
+            final int oldVis = window.getDecorView().getSystemUiVisibility();
+            newVis |= (oldVis & View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
+        }
+
         window.getDecorView().setSystemUiVisibility(newVis);
     }
 
     public static boolean isFullScreen(final Activity activity) {
         final Window window = activity.getWindow();
 
         final int vis = window.getDecorView().getSystemUiVisibility();
         return (vis & View.SYSTEM_UI_FLAG_FULLSCREEN) != 0;