diff options
author | Doris Liu <tianliu@google.com> | 2012-09-05 19:51:58 -0700 |
---|---|---|
committer | Doris Liu <tianliu@google.com> | 2012-09-05 19:51:58 -0700 |
commit | 0aa21cfcb47437ba3e3368828d472fb61729e7e4 (patch) | |
tree | e5b5dc4d005e6848bfad0ece8e82f35ad3f709e6 /src | |
parent | 0bfb719a5a7996539d7aaaa4a920c49b14c7faf7 (diff) | |
download | android_packages_apps_Snap-0aa21cfcb47437ba3e3368828d472fb61729e7e4.tar.gz android_packages_apps_Snap-0aa21cfcb47437ba3e3368828d472fb61729e7e4.tar.bz2 android_packages_apps_Snap-0aa21cfcb47437ba3e3368828d472fb61729e7e4.zip |
Fix tap to focus, back button to camera on Manta
Changed the move threshold from a hard coded value to be proportional to the size of the view.
Bug: 7080033
Bug: 7066859
Change-Id: Id7b81fb3da1783951886d43fe9a3df35186af985
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/gallery3d/ui/PhotoView.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/ui/PhotoView.java b/src/com/android/gallery3d/ui/PhotoView.java index 9a0fe9d09..0952cfc81 100644 --- a/src/com/android/gallery3d/ui/PhotoView.java +++ b/src/com/android/gallery3d/ui/PhotoView.java @@ -149,7 +149,6 @@ public class PhotoView extends GLView { private static final int MSG_UNDO_BAR_TIMEOUT = 7; private static final int MSG_UNDO_BAR_FULL_CAMERA = 8; - private static final int MOVE_THRESHOLD = 256; private static final float SWIPE_THRESHOLD = 300f; private static final float DEFAULT_TEXT_SIZE = 20; @@ -1532,7 +1531,9 @@ public class PhotoView extends GLView { Rect r = mPositionController.getPosition(0); int viewW = getWidth(); - int threshold = MOVE_THRESHOLD + gapToSide(r.width(), viewW); + // Setting the move threshold proportional to the width of the view + int moveThreshold = viewW / 5 ; + int threshold = moveThreshold + gapToSide(r.width(), viewW); // If we have moved the picture a lot, switching. if (viewW - r.right > threshold) { |