OSDN Git Service

Move to final position after view size change.
authorChih-Chung Chang <chihchung@google.com>
Wed, 30 May 2012 23:29:18 +0000 (16:29 -0700)
committerChih-Chung Chang <chihchung@google.com>
Wed, 30 May 2012 23:47:06 +0000 (16:47 -0700)
Bug: 6584188
Change-Id: If6ab23532bd7040701e358f9cdd813d2f6a71e5c

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

index 568dcf2..2d6b572 100644 (file)
@@ -1203,7 +1203,7 @@ public class PhotoView extends GLView {
             // animation.
             if (mModel.getCurrentIndex() > SCREEN_NAIL_MAX) {
                 switchToFirstImage();
-                mPositionController.skipAnimation();
+                mPositionController.skipToFinalPosition();
                 return true;
             }
 
index cf41d3a..ae0df34 100644 (file)
@@ -213,8 +213,7 @@ class PositionController {
         // If we have the opening animation, do it. Otherwise go directly to the
         // right position.
         if (!startOpeningAnimationIfNeeded()) {
-            snapAndRedraw();
-            skipAnimation();
+            skipToFinalPosition();
         }
     }
 
@@ -421,6 +420,12 @@ class PositionController {
         snapAndRedraw();
     }
 
+    public void skipToFinalPosition() {
+        stopAnimation();
+        snapAndRedraw();
+        skipAnimation();
+    }
+
     ////////////////////////////////////////////////////////////////////////////
     //  Start an animations for the focused box
     ////////////////////////////////////////////////////////////////////////////