[Android] [PATCH] Video Player: fix lint warning for ActionBar

Thomas Guillem thomas.guillem at gmail.com
Thu Oct 2 12:02:56 CEST 2014


---
 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java  | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 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 4dccca7..c1fb5b1 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -1654,6 +1654,14 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {
         showOverlay(OVERLAY_TIMEOUT);
     }
 
+    @TargetApi(Build.VERSION_CODES.HONEYCOMB)
+    private void setActionBarVisibility(boolean show) {
+        if (show)
+            mActionBar.show();
+        else
+            mActionBar.hide();
+    }
+
     /**
      * show overlay
      */
@@ -1665,7 +1673,7 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {
             mShowing = true;
             if (!mIsLocked) {
                 if (mOverlayUseStatusBar)
-                    mActionBar.show();
+                    setActionBarVisibility(true);
                 else
                     mOverlayHeader.setVisibility(View.VISIBLE);
                 mOverlayOption.setVisibility(View.VISIBLE);
@@ -1706,7 +1714,7 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {
                 mOverlayBackground.setVisibility(View.INVISIBLE);
             }
             if (mOverlayUseStatusBar)
-                mActionBar.hide();
+                setActionBarVisibility(false);
             else
                 mOverlayHeader.setVisibility(View.INVISIBLE);
             mOverlayOption.setVisibility(View.INVISIBLE);
-- 
2.1.0



More information about the Android mailing list