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/Util.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/Util.java')
-rw-r--r-- | src/com/android/camera/Util.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/com/android/camera/Util.java b/src/com/android/camera/Util.java index 5cafe7a..de176c4 100644 --- a/src/com/android/camera/Util.java +++ b/src/com/android/camera/Util.java @@ -443,4 +443,12 @@ public class Util { return (intentCameraId == android.hardware.Camera.CameraInfo.CAMERA_FACING_BACK); } + private static int mLocation[] = new int[2]; + + // This method is not thread-safe. + public static boolean pointInView(float x, float y, View v) { + v.getLocationInWindow(mLocation); + return x >= mLocation[0] && x < (mLocation[0] + v.getWidth()) + && y >= mLocation[1] && y < (mLocation[1] + v.getHeight()); + } } |