summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoris Liu <tianliu@google.com>2013-04-24 22:38:18 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-04-24 22:38:18 +0000
commitce019e94d92f0097d73a6fc986d0a1e593b74b4d (patch)
treef0b0d69da7778272685e3f2504c99a1b76be50a5
parent6d73e4574907809bf328f1535cd88d7ec564804b (diff)
parentfd2e619a2fb263315816b3579a9c6751c398132d (diff)
downloadandroid_packages_apps_Snap-ce019e94d92f0097d73a6fc986d0a1e593b74b4d.tar.gz
android_packages_apps_Snap-ce019e94d92f0097d73a6fc986d0a1e593b74b4d.tar.bz2
android_packages_apps_Snap-ce019e94d92f0097d73a6fc986d0a1e593b74b4d.zip
Merge "Fix for popuping being hard to dismiss" into gb-ub-photos-bryce
-rw-r--r--src/com/android/camera/PhotoUI.java6
-rw-r--r--src/com/android/camera/PreviewGestures.java5
-rw-r--r--src/com/android/camera/VideoUI.java6
3 files changed, 11 insertions, 6 deletions
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index ea1cb9036..3f2945f10 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -309,9 +309,7 @@ public class PhotoUI implements PieListener,
}
public boolean dispatchTouchEvent(MotionEvent m) {
- if (mPopup != null) {
- return mActivity.superDispatchTouchEvent(m);
- } else if (mGestures != null && mRenderOverlay != null) {
+ if (mGestures != null && mRenderOverlay != null) {
return mGestures.dispatchTouch(m);
}
return false;
@@ -382,6 +380,7 @@ public class PhotoUI implements PieListener,
LayoutParams.WRAP_CONTENT);
lp.gravity = Gravity.CENTER;
((FrameLayout) mRootView).addView(mPopup, lp);
+ mGestures.addTouchReceiver(mPopup);
}
public void dismissPopup(boolean topPopupOnly) {
@@ -395,6 +394,7 @@ public class PhotoUI implements PieListener,
}
setShowMenu(fullScreen);
if (mPopup != null) {
+ mGestures.removeTouchReceiver(mPopup);
((FrameLayout) mRootView).removeView(mPopup);
mPopup = null;
}
diff --git a/src/com/android/camera/PreviewGestures.java b/src/com/android/camera/PreviewGestures.java
index 90ab075d2..0b80ff688 100644
--- a/src/com/android/camera/PreviewGestures.java
+++ b/src/com/android/camera/PreviewGestures.java
@@ -128,6 +128,11 @@ public class PreviewGestures
mReceivers.add(v);
}
+ public void removeTouchReceiver(View v) {
+ if (mReceivers == null || v == null) return;
+ mReceivers.remove(v);
+ }
+
public void addUnclickableArea(View v) {
if (mUnclickableAreas == null) {
mUnclickableAreas = new ArrayList<View>();
diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java
index 874a8f22d..16a9d3c86 100644
--- a/src/com/android/camera/VideoUI.java
+++ b/src/com/android/camera/VideoUI.java
@@ -281,6 +281,7 @@ public class VideoUI implements SurfaceHolder.Callback, PieRenderer.PieListener,
LayoutParams.WRAP_CONTENT);
lp.gravity = Gravity.CENTER;
((FrameLayout) mRootView).addView(mPopup, lp);
+ mGestures.addTouchReceiver(mPopup);
}
public void dismissPopup(boolean topLevelOnly) {
@@ -294,6 +295,7 @@ public class VideoUI implements SurfaceHolder.Callback, PieRenderer.PieListener,
}
setShowMenu(fullScreen);
if (mPopup != null) {
+ mGestures.removeTouchReceiver(mPopup);
((FrameLayout) mRootView).removeView(mPopup);
mPopup = null;
}
@@ -472,10 +474,8 @@ public class VideoUI implements SurfaceHolder.Callback, PieRenderer.PieListener,
}
public boolean dispatchTouchEvent(MotionEvent m) {
- if (mPopup == null && mGestures != null && mRenderOverlay != null) {
+ if (mGestures != null && mRenderOverlay != null) {
return mGestures.dispatchTouch(m);
- } else if (mPopup != null) {
- return mActivity.superDispatchTouchEvent(m);
}
return false;
}