[Android] Simplify dimStatusBar() algorithm

Geoffrey Métais git at videolan.org
Tue Mar 1 18:09:35 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Mar  1 18:05:42 2016 +0100| [329b040b97801044bd9e3bb66d5a0f5464f00ba3] | committer: Geoffrey Métais

Simplify dimStatusBar() algorithm

> https://code.videolan.org/videolan/vlc-android/commit/329b040b97801044bd9e3bb66d5a0f5464f00ba3
---

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java    | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index f8225e2..0631aef 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -2548,13 +2548,12 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
         int visibility = 0;
         int navbar = 0;
 
-        if (!AndroidDevices.hasCombBar() && AndroidUtil.isJellyBeanOrLater()) {
-            visibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
+        if (AndroidUtil.isJellyBeanOrLater()) {
+            visibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
             navbar = View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
         }
-        if (AndroidUtil.isJellyBeanOrLater())
-            visibility |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
         if (dim || mIsLocked) {
+            getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
             if (AndroidUtil.isICSOrLater())
                 navbar |= View.SYSTEM_UI_FLAG_LOW_PROFILE;
             else
@@ -2566,8 +2565,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
                 if (AndroidUtil.isJellyBeanOrLater())
                     visibility |= View.SYSTEM_UI_FLAG_FULLSCREEN;
             }
-        }
-        if (!dim) {
+        } else {
             getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
             if (AndroidUtil.isICSOrLater())
                 visibility |= View.SYSTEM_UI_FLAG_VISIBLE;



More information about the Android mailing list