diff options
author | Angus Kong <shkong@google.com> | 2013-10-09 15:53:29 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-10-09 15:53:29 +0000 |
commit | 6939d143cb52a012b1b9cd9a141156357367b212 (patch) | |
tree | e8c671399fba223d997325241b96663f1dc1a48e /src | |
parent | 6ddd31b9284bbbfcf891766f9d6238bfd5cde721 (diff) | |
parent | da568b23002859e9672271bb135808303c2e07cb (diff) | |
download | android_packages_apps_Snap-6939d143cb52a012b1b9cd9a141156357367b212.tar.gz android_packages_apps_Snap-6939d143cb52a012b1b9cd9a141156357367b212.tar.bz2 android_packages_apps_Snap-6939d143cb52a012b1b9cd9a141156357367b212.zip |
Merge "Make the transition animation identical." into gb-ub-photos-carlsbad
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/ui/FilmStripView.java | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/src/com/android/camera/ui/FilmStripView.java b/src/com/android/camera/ui/FilmStripView.java index d8c166004..56f5dfac8 100644 --- a/src/com/android/camera/ui/FilmStripView.java +++ b/src/com/android/camera/ui/FilmStripView.java @@ -1204,21 +1204,36 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener { } // Right items. for (int itemID = mCurrentItem + 1; itemID < BUFFER_SIZE; itemID++) { - ViewItem curr = mViewItem[itemID]; + final ViewItem curr = mViewItem[itemID]; if (curr == null) { break; } // First, layout relatively to the previous one. - ViewItem prev = mViewItem[itemID - 1]; - int currLeft = + final ViewItem prev = mViewItem[itemID - 1]; + final int currLeft = prev.getLeftPosition() + prev.getView().getMeasuredWidth() + mViewGap; curr.setLeftPosition(currLeft); } + // Special case for the one immediately on the right of the camera + // preview. + boolean immediateRight = + (mViewItem[mCurrentItem].getId() == 1 && + mDataAdapter.getImageData(0).getViewType() == ImageData.VIEW_TYPE_STICKY); + // Layout the current ViewItem first. - if (scaleFraction == 1f) { + if (immediateRight) { + // Just do a simple layout without any special translation or + // fading. The implementation in Gallery does not push the first + // photo to the bottom of the camera preview. Simply place the + // photo on the right of the preview. + final ViewItem currItem = mViewItem[mCurrentItem]; + currItem.layoutIn(mDrawArea, mCenterX, mScale); + currItem.setTranslationX(0f, mScale); + currItem.getView().setAlpha(1f); + } else if (scaleFraction == 1f) { final ViewItem currItem = mViewItem[mCurrentItem]; final int currCenterX = currItem.getCenterX(); if (mCenterX < currCenterX) { @@ -1267,13 +1282,19 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener { // Items on the right for (int itemID = mCurrentItem + 1; itemID < BUFFER_SIZE; itemID++) { - ViewItem curr = mViewItem[itemID]; + final ViewItem curr = mViewItem[itemID]; if (curr == null) { break; } curr.layoutIn(mDrawArea, mCenterX, mScale); - View currView = curr.getView(); + if (curr.getId() == 1 && getCurrentViewType() == ImageData.VIEW_TYPE_STICKY) { + // Special case for the one next to the camera preview. + curr.getView().setAlpha(1f); + continue; + } + + final View currView = curr.getView(); if (scaleFraction == 1) { // It's in full-screen mode. fadeAndScaleRightViewItem(itemID); |