diff options
author | Bobby Georgescu <georgescu@google.com> | 2012-10-15 13:48:08 -0700 |
---|---|---|
committer | Bobby Georgescu <georgescu@google.com> | 2012-10-16 16:30:17 -0700 |
commit | 5585826e68c62c3719fb346d40fd1999438c6c6b (patch) | |
tree | c6a161bc84c2c4b6222bb2035e2993233c42fc15 /src/com/android/gallery3d/app/AlbumPage.java | |
parent | e34a5a5eaedb870798a5cc7415079d04a6ca42e0 (diff) | |
download | android_packages_apps_Gallery2-5585826e68c62c3719fb346d40fd1999438c6c6b.tar.gz android_packages_apps_Gallery2-5585826e68c62c3719fb346d40fd1999438c6c6b.tar.bz2 android_packages_apps_Gallery2-5585826e68c62c3719fb346d40fd1999438c6c6b.zip |
Consistent animations & up button behavior in Gallery
Bug: 7302857
Bug: 7295464
This CL makes all of the transition animations throughout
the Gallery app consistent. The animation is the previous
view shrinking and fading out while the new view starts out
bigger than the view port and is coming in to the viewport
size as it fades in. Having consistent animations allows us
to not keep PhotoPage/AlbumPage instances around in certain
cases, making it possible to have consistent up button
behavior when switching between the grid and filmstrip.
Finally, this also makes the transitions in the camera app
filmstrip/grid switching consistent with those in the
gallery app.
Change-Id: I77bac6a0cde1e439738c78f9e16ab15ed5910cfb
Diffstat (limited to 'src/com/android/gallery3d/app/AlbumPage.java')
-rw-r--r-- | src/com/android/gallery3d/app/AlbumPage.java | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/src/com/android/gallery3d/app/AlbumPage.java b/src/com/android/gallery3d/app/AlbumPage.java index c956bc969..edaf8caa7 100644 --- a/src/com/android/gallery3d/app/AlbumPage.java +++ b/src/com/android/gallery3d/app/AlbumPage.java @@ -47,7 +47,6 @@ import com.android.gallery3d.ui.GLCanvas; import com.android.gallery3d.ui.GLRoot; import com.android.gallery3d.ui.GLView; import com.android.gallery3d.ui.PhotoFallbackEffect; -import com.android.gallery3d.ui.PreparePageFadeoutTexture; import com.android.gallery3d.ui.RelativePosition; import com.android.gallery3d.ui.SelectionManager; import com.android.gallery3d.ui.SlotView; @@ -139,11 +138,6 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster private final float mMatrix[] = new float[16]; @Override - protected void renderBackground(GLCanvas view) { - view.clearBuffer(getBackgroundColor()); - } - - @Override protected void onLayout( boolean changed, int left, int top, int right, int bottom) { @@ -254,8 +248,6 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster } else { // Render transition in pressed state mAlbumView.setPressedIndex(slotIndex); - PreparePageFadeoutTexture.prepareFadeOutTexture(mActivity, mRootPane); - mAlbumView.setPressedIndex(-1); pickPhoto(slotIndex); } @@ -300,8 +292,12 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster data.putBoolean(PhotoPage.KEY_START_IN_FILMSTRIP, startInFilmstrip); data.putBoolean(PhotoPage.KEY_IN_CAMERA_ROLL, mMediaSet.isCameraRoll()); - mActivity.getStateManager().startStateForResult( - PhotoPage.class, REQUEST_PHOTO, data); + if (startInFilmstrip) { + mActivity.getStateManager().switchState(this, PhotoPage.class, data); + } else { + mActivity.getStateManager().startStateForResult( + PhotoPage.class, REQUEST_PHOTO, data); + } } } @@ -373,15 +369,6 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster mLaunchedFromPhotoPage = mActivity.getStateManager().hasStateClass(PhotoPage.class); mInCameraApp = data.getBoolean(PhotoPage.KEY_APP_BRIDGE, false); - - // Don't show animation if it is restored or switched from filmstrip - if (!mLaunchedFromPhotoPage && restoreState == null && data != null) { - int[] center = data.getIntArray(KEY_SET_CENTER); - if (center != null) { - mOpenCenter.setAbsolutePosition(center[0], center[1]); - mSlotView.startScatteringAnimation(mOpenCenter); - } - } } @Override @@ -411,6 +398,7 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster mAlbumDataAdapter.resume(); mAlbumView.resume(); + mAlbumView.setPressedIndex(-1); mActionModeHandler.resume(); if (!mInitialSynced) { setLoadingBit(BIT_LOADING_SYNC); @@ -561,7 +549,6 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster if (mAlbumDataAdapter == null || !mAlbumDataAdapter.isActive(slotIndex)) return; MediaItem item = mAlbumDataAdapter.get(slotIndex); if (item == null) return; - PreparePageFadeoutTexture.prepareFadeOutTexture(mActivity, mRootPane); TransitionStore transitions = mActivity.getTransitionStore(); transitions.put(PhotoPage.KEY_INDEX_HINT, slotIndex); transitions.put(PhotoPage.KEY_OPEN_ANIMATION_RECT, |