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 | cda9315a4b3fb0228cbcd3e9a18d8c90f0a8a3e0 (patch) | |
tree | 4fbc5b95399d6befaa4628a00f3d05a543b74d09 /src/com/android/gallery3d/ui/PhotoView.java | |
parent | 581f8fc2f7b9453cb91ba0eacd3412f8c99a6e38 (diff) | |
download | android_packages_apps_Gallery2-cda9315a4b3fb0228cbcd3e9a18d8c90f0a8a3e0.tar.gz android_packages_apps_Gallery2-cda9315a4b3fb0228cbcd3e9a18d8c90f0a8a3e0.tar.bz2 android_packages_apps_Gallery2-cda9315a4b3fb0228cbcd3e9a18d8c90f0a8a3e0.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/com/android/gallery3d/ui/PhotoView.java')
-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) { |