summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorkaiyiz <kaiyiz@codeaurora.org>2015-03-05 09:52:48 +0800
committerkaiyiz <kaiyiz@codeaurora.org>2015-03-05 09:52:48 +0800
commit93b631a1c15d39938c98532f52ffc0f3ede2ea3f (patch)
tree9ead24ab3e15fe1665e01db48b2d38a17f7232dd /src
parentce7d8bd2dd6f864908b9b0d1d2459de4ebe910b6 (diff)
downloadandroid_packages_apps_Gallery2-93b631a1c15d39938c98532f52ffc0f3ede2ea3f.zip
android_packages_apps_Gallery2-93b631a1c15d39938c98532f52ffc0f3ede2ea3f.tar.gz
android_packages_apps_Gallery2-93b631a1c15d39938c98532f52ffc0f3ede2ea3f.tar.bz2
Gallery2: Menu options list disappears very fast
Video playback UI in accordance with the 2.5 seconds interval automatically hide, and the Actionbar overflow menu is hidden, the UI is going to hide, the menu display time less than 2.5 seconds. When the UI is hidden, click the Actionbar overflow time after the restart the hidden. CRs-Fixed: 801773 Change-Id: I136980d246adfe0d62d452a3a5840efa1ce6e539
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/app/MovieActivity.java13
-rw-r--r--src/com/android/gallery3d/app/MovieControllerOverlay.java4
-rwxr-xr-xsrc/com/android/gallery3d/app/MoviePlayer.java12
3 files changed, 27 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/app/MovieActivity.java b/src/com/android/gallery3d/app/MovieActivity.java
index 5c857d4..0b0341a 100644
--- a/src/com/android/gallery3d/app/MovieActivity.java
+++ b/src/com/android/gallery3d/app/MovieActivity.java
@@ -18,6 +18,7 @@ package com.android.gallery3d.app;
import android.annotation.TargetApi;
import android.app.ActionBar;
+import android.app.ActionBar.OnMenuVisibilityListener;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.KeyguardManager;
@@ -265,6 +266,18 @@ public class MovieActivity extends Activity {
ActionBar.DISPLAY_HOME_AS_UP | ActionBar.DISPLAY_SHOW_TITLE,
ActionBar.DISPLAY_HOME_AS_UP | ActionBar.DISPLAY_SHOW_TITLE);
+ actionBar.addOnMenuVisibilityListener(new OnMenuVisibilityListener() {
+ @Override
+ public void onMenuVisibilityChanged(boolean isVisible) {
+ if (mPlayer != null) {
+ if (isVisible) {
+ mPlayer.cancelHidingController();
+ } else {
+ mPlayer.restartHidingController();
+ }
+ }
+ }
+ });
String title = intent.getStringExtra(Intent.EXTRA_TITLE);
if (title != null) {
actionBar.setTitle(title);
diff --git a/src/com/android/gallery3d/app/MovieControllerOverlay.java b/src/com/android/gallery3d/app/MovieControllerOverlay.java
index 93fc3cf..bb25882 100644
--- a/src/com/android/gallery3d/app/MovieControllerOverlay.java
+++ b/src/com/android/gallery3d/app/MovieControllerOverlay.java
@@ -196,7 +196,7 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements
maybeStartHiding();
}
- private void maybeStartHiding() {
+ public void maybeStartHiding() {
cancelHiding();
if (mState == State.PLAYING) {
handler.postDelayed(startHidingRunnable, 2500);
@@ -221,7 +221,7 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements
}
}
- private void cancelHiding() {
+ public void cancelHiding() {
handler.removeCallbacks(startHidingRunnable);
if (mOverlayExt.canHidePanel()) {
mBackground.setAnimation(null);
diff --git a/src/com/android/gallery3d/app/MoviePlayer.java b/src/com/android/gallery3d/app/MoviePlayer.java
index e6702b5..4c0df84 100755
--- a/src/com/android/gallery3d/app/MoviePlayer.java
+++ b/src/com/android/gallery3d/app/MoviePlayer.java
@@ -1575,6 +1575,18 @@ public class MoviePlayer implements
videoPlayerData, 0);
return (mPrefs.getInt(slectedStepOption, stepOptionThreeSeconds) + 1) * stepBase;
}
+
+ public void restartHidingController() {
+ if (mController != null) {
+ mController.maybeStartHiding();
+ }
+ }
+
+ public void cancelHidingController() {
+ if (mController != null) {
+ mController.cancelHiding();
+ }
+ }
}
class Bookmarker {