OSDN Git Service

Do not accept fling gesture after we changed from/to filmstrip mode.
authorChih-Chung Chang <chihchung@google.com>
Thu, 6 Sep 2012 12:02:09 +0000 (20:02 +0800)
committerThe Android Automerger <android-build@android.com>
Mon, 10 Sep 2012 22:27:08 +0000 (15:27 -0700)
Change-Id: Ifb3d692bcf621ff02c6d4e6d91ba8484d702f905

src/com/android/gallery3d/ui/PhotoView.java

index e44905d..821032b 100644 (file)
@@ -916,8 +916,6 @@ public class PhotoView extends GLView {
         private boolean mModeChanged;
         // If this scaling gesture should be ignored.
         private boolean mIgnoreScalingGesture;
-        // If we have seen a scaling gesture.
-        private boolean mSeenScaling;
         // whether the down action happened while the view is scrolling.
         private boolean mDownInScrolling;
         // If we should ignore all gestures other than onSingleTapUp.
@@ -1022,7 +1020,7 @@ public class PhotoView extends GLView {
         @Override
         public boolean onFling(float velocityX, float velocityY) {
             if (mIgnoreSwipingGesture) return true;
-            if (mSeenScaling) return true;
+            if (mModeChanged) return true;
             if (swipeImages(velocityX, velocityY)) {
                 mIgnoreUpEvent = true;
             } else {
@@ -1094,8 +1092,6 @@ public class PhotoView extends GLView {
             // mode and at minimal scale.
             mCanChangeMode = mFilmMode
                     || mPositionController.isAtMinimalScale();
-            mModeChanged = false;
-            mSeenScaling = true;
             mAccScale = 1f;
             return true;
         }
@@ -1172,7 +1168,7 @@ public class PhotoView extends GLView {
             checkHideUndoBar(UNDO_BAR_TOUCHED);
 
             mDeltaY = 0;
-            mSeenScaling = false;
+            mModeChanged = false;
 
             if (mIgnoreSwipingGesture) return;