summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2016-01-10 14:14:25 +0100
committerMichael Bestas <mikeioannina@gmail.com>2017-01-04 21:57:43 +0200
commit4b97646fca2d3b2b92b5b2f04851c9260f178436 (patch)
tree3ad924b0b51cce07606cafe8ba3f476b9131efb4
parent377973fbe84dbcec3dc331b15dd3bb9fa1dfe452 (diff)
downloadandroid_packages_apps_Snap-4b97646fca2d3b2b92b5b2f04851c9260f178436.tar.gz
android_packages_apps_Snap-4b97646fca2d3b2b92b5b2f04851c9260f178436.tar.bz2
android_packages_apps_Snap-4b97646fca2d3b2b92b5b2f04851c9260f178436.zip
Don't do touch-to-focus for touches outside of the preview.
Issue was twofold: - Preview size was updated from the root view instead of the preview surface view. As the preview rect is already correctly updated from the surface view, remove the redundant size update code. - Touches outside of the preview rect weren't discarded properly. Change-Id: I1c9a4398aa51a828b5362fcd7bcd5a7a7e4691db
-rw-r--r--src/com/android/camera/FocusOverlayManager.java2
-rwxr-xr-xsrc/com/android/camera/PhotoModule.java6
2 files changed, 1 insertions, 7 deletions
diff --git a/src/com/android/camera/FocusOverlayManager.java b/src/com/android/camera/FocusOverlayManager.java
index 875fe779f..24a2befbc 100644
--- a/src/com/android/camera/FocusOverlayManager.java
+++ b/src/com/android/camera/FocusOverlayManager.java
@@ -383,7 +383,7 @@ public class FocusOverlayManager {
mState == STATE_SUCCESS || mState == STATE_FAIL)) {
cancelAutoFocus();
}
- if (mPreviewRect.width() == 0 || mPreviewRect.height() == 0) return;
+ if (mPreviewRect.isEmpty() || !mPreviewRect.contains(x, y)) return;
// Initialize variables.
// Initialize mFocusArea.
if (mFocusAreaSupported) {
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 4ec0a47c4..250e66d6a 100755
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -2689,12 +2689,6 @@ public class PhotoModule
// we will update focus manager with proper UI.
if (mFocusManager != null && mUI != null) {
mFocusManager.setPhotoUI(mUI);
-
- View root = mUI.getRootView();
- // These depend on camera parameters.
- int width = root.getWidth();
- int height = root.getHeight();
- mFocusManager.setPreviewSize(width, height);
}
}