Merge "Fix for popuping being hard to dismiss" into gb-ub-photos-bryce
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index ea1cb90..3f2945f 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -309,9 +309,7 @@
}
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 @@
LayoutParams.WRAP_CONTENT);
lp.gravity = Gravity.CENTER;
((FrameLayout) mRootView).addView(mPopup, lp);
+ mGestures.addTouchReceiver(mPopup);
}
public void dismissPopup(boolean topPopupOnly) {
@@ -395,6 +394,7 @@
}
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 90ab075..0b80ff6 100644
--- a/src/com/android/camera/PreviewGestures.java
+++ b/src/com/android/camera/PreviewGestures.java
@@ -128,6 +128,11 @@
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 874a8f2..16a9d3c 100644
--- a/src/com/android/camera/VideoUI.java
+++ b/src/com/android/camera/VideoUI.java
@@ -281,6 +281,7 @@
LayoutParams.WRAP_CONTENT);
lp.gravity = Gravity.CENTER;
((FrameLayout) mRootView).addView(mPopup, lp);
+ mGestures.addTouchReceiver(mPopup);
}
public void dismissPopup(boolean topLevelOnly) {
@@ -294,6 +295,7 @@
}
setShowMenu(fullScreen);
if (mPopup != null) {
+ mGestures.removeTouchReceiver(mPopup);
((FrameLayout) mRootView).removeView(mPopup);
mPopup = null;
}
@@ -472,10 +474,8 @@
}
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;
}