summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRay Chen <raychen@google.com>2012-05-22 17:34:29 +0800
committerRay Chen <raychen@google.com>2012-05-23 17:06:49 +0800
commite1e712d28efea7b55e225c660e855e507594a990 (patch)
tree0b12b45826806c5580a0f325618a894aeb8212f6 /src
parent6ca39c75e668eab51645f33117cae5156f64975d (diff)
downloadandroid_packages_apps_Snap-e1e712d28efea7b55e225c660e855e507594a990.tar.gz
android_packages_apps_Snap-e1e712d28efea7b55e225c660e855e507594a990.tar.bz2
android_packages_apps_Snap-e1e712d28efea7b55e225c660e855e507594a990.zip
Fix 6519765 Ghosting is seen when hiding the actionbar in fullscreen video playback mode
b:6519765 Ensure SYSTEM_UI_FLAG_LAYOUT_STABLE and SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN is set in all states so ActionBarOverlayLayout can response to fitSystemWindows and onSystemVisibilityChange correctly. Change-Id: I41a33c9e7d21243bde6fa64e6cd1b709e7b04203
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/app/MoviePlayer.java20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/com/android/gallery3d/app/MoviePlayer.java b/src/com/android/gallery3d/app/MoviePlayer.java
index 2c8f9eb36..565d2b239 100644
--- a/src/com/android/gallery3d/app/MoviePlayer.java
+++ b/src/com/android/gallery3d/app/MoviePlayer.java
@@ -76,6 +76,7 @@ public class MoviePlayer implements
private long mResumeableTime = Long.MAX_VALUE;
private int mVideoPosition = 0;
private boolean mHasPaused = false;
+ private int mLastSystemUiVis = 0;
// If the time bar is being dragged.
private boolean mDragging;
@@ -134,7 +135,10 @@ public class MoviePlayer implements
mVideoView.setOnSystemUiVisibilityChangeListener(
new View.OnSystemUiVisibilityChangeListener() {
public void onSystemUiVisibilityChange(int visibility) {
- if ((visibility & View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) == 0) {
+ int diff = mLastSystemUiVis ^ visibility;
+ mLastSystemUiVis = visibility;
+ if ((diff & View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) != 0
+ && (visibility & View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) == 0) {
mAllowShowingSystemUI = true;
mController.show();
}
@@ -168,14 +172,14 @@ public class MoviePlayer implements
}
private void showSystemUi(boolean visible) {
- int flag = visible ? 0 : View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
- View.SYSTEM_UI_FLAG_LOW_PROFILE;
- mVideoView.setSystemUiVisibility(flag);
- if (visible) {
- mActionBar.show();
- } else {
- mActionBar.hide();
+ int flag = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+ | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
+ | View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
+ if (!visible) {
+ flag |= View.SYSTEM_UI_FLAG_LOW_PROFILE | View.SYSTEM_UI_FLAG_FULLSCREEN
+ | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
}
+ mVideoView.setSystemUiVisibility(flag);
}
public void onSaveInstanceState(Bundle outState) {