OSDN Git Service

Make transition from album page to photo page even smoother
authorBobby Georgescu <georgescu@google.com>
Sat, 25 Aug 2012 06:59:28 +0000 (23:59 -0700)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Mon, 27 Aug 2012 05:36:49 +0000 (22:36 -0700)
Bug: 6979922
Bug: 7050303
Change-Id: Iaa2582125f0706a34317fa90fea73749cd2cf995

src/com/android/gallery3d/app/AlbumPage.java
src/com/android/gallery3d/app/PhotoPage.java
src/com/android/gallery3d/ui/PositionController.java

index 5328678..8e65bc0 100644 (file)
@@ -269,10 +269,9 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster
         } else {
             // Show pressed-up animation for the single-tap.
             mAlbumView.setPressedIndex(slotIndex);
-            mAlbumView.setPressedUp();
-            mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_PICK_PHOTO, slotIndex, 0),
-                    FadeTexture.DURATION);
             prepareFadeOutTexture();
+            mAlbumView.setPressedIndex(-1);
+            pickPhoto(slotIndex);
         }
     }
 
index 2458b9a..43867bb 100644 (file)
@@ -133,7 +133,7 @@ public class PhotoPage extends ActivityState implements
 
     private RawTexture mFadeOutTexture;
     private Rect mOpenAnimationRect;
-    public static final int ANIM_TIME_OPENING = 300;
+    public static final int ANIM_TIME_OPENING = 400;
 
     // The item that is deleted (but it can still be undeleted before commiting)
     private Path mDeletePath;
@@ -191,7 +191,7 @@ public class PhotoPage extends ActivityState implements
                         view.setAlpha(fadeAlpha);
                     }
                     mFadeOutTexture.draw(view, 0, 0);
-                    view.setAlpha(1f);
+                    view.setAlpha(1f - fadeAlpha);
                     return;
                 }
             }
index b1b3c37..16e9f7b 100644 (file)
@@ -1417,12 +1417,10 @@ class PositionController {
                 case ANIM_KIND_CAPTURE:
                     progress = 1 - f;  // linear
                     break;
+                case ANIM_KIND_OPENING:
                 case ANIM_KIND_SCALE:
                     progress = 1 - f * f;  // quadratic
                     break;
-                case ANIM_KIND_OPENING:
-                    progress = 1 - f * f * f;  // x^3
-                    break;
                 case ANIM_KIND_SNAPBACK:
                 case ANIM_KIND_ZOOM:
                 case ANIM_KIND_SLIDE: