diff options
author | Wu-cheng Li <wuchengli@google.com> | 2011-04-27 17:23:10 +0800 |
---|---|---|
committer | Wu-cheng Li <wuchengli@google.com> | 2011-04-28 13:24:26 +0800 |
commit | 97d089d718dc92c0e9ccc3c923066cf4f0101c35 (patch) | |
tree | 190bbf95855939174b4cb8f7cdf8990f2e6ed8a9 /src/com/android/camera/VideoCamera.java | |
parent | feaf2ccff42c44b74be814b66296f9ddedcc9aa9 (diff) | |
download | LegacyCamera-97d089d718dc92c0e9ccc3c923066cf4f0101c35.zip LegacyCamera-97d089d718dc92c0e9ccc3c923066cf4f0101c35.tar.gz LegacyCamera-97d089d718dc92c0e9ccc3c923066cf4f0101c35.tar.bz2 |
Do not trigger touch focus when popup window is dismissed.
Also use getLocationInWindow instead of getLocationOnScreen.
bug:3475893
Change-Id: I6e5917cf7340a7968fd07c13bf91e3c555d0cf87
Diffstat (limited to 'src/com/android/camera/VideoCamera.java')
-rw-r--r-- | src/com/android/camera/VideoCamera.java | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index 2a5fbc3..03944a1 100644 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -1941,28 +1941,20 @@ public class VideoCamera extends ActivityBase return super.dispatchTouchEvent(m); } - private int mLocation[] = new int[2]; private class PopupGestureListener extends GestureDetector.SimpleOnGestureListener { @Override public boolean onDown(MotionEvent e) { // Check if the popup window is visible. - View v = mIndicatorWheel.getActivePopupWindow(); - if (v == null) return false; - - int x = Math.round(e.getX()); - int y = Math.round(e.getY()); - - // Dismiss the popup window if users touch on the outside. - v.getLocationOnScreen(mLocation); - if (x < mLocation[0] || (x > mLocation[0] + v.getWidth()) - || y < mLocation[1] || (y > mLocation[1] + v.getHeight())) { - // Let indicator wheel handle its own event. - mIndicatorWheel.getLocationOnScreen(mLocation); - if (x < mLocation[0] || (x > mLocation[0] + mIndicatorWheel.getWidth()) - || y < mLocation[1] || (y > mLocation[1] + mIndicatorWheel.getHeight())) { - mIndicatorWheel.dismissSettingPopup(); - } + View popup = mIndicatorWheel.getActivePopupWindow(); + if (popup == null) return false; + + // Let popup window or indicator wheel handle the event by + // themselves. Dismiss the popup window if users touch on other + // areas. + if (!Util.pointInView(e.getX(), e.getY(), popup) + && !Util.pointInView(e.getX(), e.getY(), mIndicatorWheel)) { + mIndicatorWheel.dismissSettingPopup(); // Let event fall through. } return false; |