diff options
| author | Chih-Chung Chang <chihchung@google.com> | 2012-04-18 20:08:57 +0800 |
|---|---|---|
| committer | Chih-Chung Chang <chihchung@google.com> | 2012-04-18 20:31:10 +0800 |
| commit | 099989b310d84fe13eff0cdf2902bb3fb0bcbd14 (patch) | |
| tree | 63153419c3fa6a0b5949aa3f1e93c8f6be2f5ffd /src/com | |
| parent | b8be1e0ad76b6abc0da7ead39f7a9811195d001e (diff) | |
| download | android_packages_apps_Gallery2-099989b310d84fe13eff0cdf2902bb3fb0bcbd14.tar.gz android_packages_apps_Gallery2-099989b310d84fe13eff0cdf2902bb3fb0bcbd14.tar.bz2 android_packages_apps_Gallery2-099989b310d84fe13eff0cdf2902bb3fb0bcbd14.zip | |
Film strip should be accessible only when an image is its default state.
Change-Id: I4df0db809f6a3f8d28b4e7bbbcddc3fa19d35387
Diffstat (limited to 'src/com')
| -rw-r--r-- | src/com/android/gallery3d/ui/PhotoView.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/ui/PhotoView.java b/src/com/android/gallery3d/ui/PhotoView.java index f0b4a12e7..89475c4b6 100644 --- a/src/com/android/gallery3d/ui/PhotoView.java +++ b/src/com/android/gallery3d/ui/PhotoView.java @@ -534,7 +534,8 @@ public class PhotoView extends GLView { private class MyGestureListener implements GestureRecognizer.Listener { private boolean mIgnoreUpEvent = false; - + // If we can change mode for this scale gesture. + private boolean mCanChangeMode; // If we have changed the mode in this scaling gesture. private boolean mModeChanged; @@ -585,6 +586,10 @@ public class PhotoView extends GLView { @Override public boolean onScaleBegin(float focusX, float focusY) { mPositionController.beginScale(focusX, focusY); + // We can change mode if we are in film mode, or we are in page + // mode and at minimal scale. + mCanChangeMode = mFilmMode + || mPositionController.isAtMinimalScale(); mModeChanged = false; return true; } @@ -595,7 +600,7 @@ public class PhotoView extends GLView { int outOfRange = mPositionController.scaleBy(scale, focusX, focusY); // We allow only one mode change in a scaling gesture. - if (!mModeChanged) { + if (mCanChangeMode && !mModeChanged) { if ((outOfRange < 0 && !mFilmMode) || (outOfRange > 0 && mFilmMode)) { setFilmMode(!mFilmMode); |
