diff options
author | Yuli Huang <yuli@google.com> | 2012-05-16 19:25:16 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-05-16 19:25:16 -0700 |
commit | 3b6b379870fa7899a33e7f5fb8d40f4966694216 (patch) | |
tree | f0e2fc2977fcb56dc413e7746313d2ca82810b05 /src/com/android/gallery3d/ui/PositionController.java | |
parent | 6607de80c095fcd7bdc4fab14cc5a970e661d36e (diff) | |
parent | 3c3b07e3a1511e736d5629c2bc4573d34c48f3ec (diff) | |
download | android_packages_apps_Snap-3b6b379870fa7899a33e7f5fb8d40f4966694216.tar.gz android_packages_apps_Snap-3b6b379870fa7899a33e7f5fb8d40f4966694216.tar.bz2 android_packages_apps_Snap-3b6b379870fa7899a33e7f5fb8d40f4966694216.zip |
Merge "Fix card effect shown in opening animation." into jb-dev
Diffstat (limited to 'src/com/android/gallery3d/ui/PositionController.java')
-rw-r--r-- | src/com/android/gallery3d/ui/PositionController.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/ui/PositionController.java b/src/com/android/gallery3d/ui/PositionController.java index 99d36baec..1be601e1d 100644 --- a/src/com/android/gallery3d/ui/PositionController.java +++ b/src/com/android/gallery3d/ui/PositionController.java @@ -286,12 +286,21 @@ class PositionController { // Start animation from the saved rectangle if we have one. Rect r = mOpenAnimationRect; mOpenAnimationRect = null; + mPlatform.mCurrentX = r.centerX() - mViewW / 2; b.mCurrentY = r.centerY() - mViewH / 2; b.mCurrentScale = Math.max(r.width() / (float) b.mImageW, r.height() / (float) b.mImageH); startAnimation(mPlatform.mDefaultX, 0, b.mScaleMin, ANIM_KIND_OPENING); + + // Animate from large gaps for neighbor boxes to avoid them + // shown on the screen during opening animation. + for (int i = -1; i < 1; i++) { + Gap g = mGaps.get(i); + g.mCurrentGap = mViewW; + g.doAnimation(g.mDefaultSize, ANIM_KIND_OPENING); + } } public void setFilmMode(boolean enabled) { @@ -661,6 +670,13 @@ class PositionController { if (changed) redraw(); } + public boolean inOpeningAnimation() { + return (mPlatform.mAnimationKind == ANIM_KIND_OPENING && + mPlatform.mAnimationStartTime != NO_ANIMATION) || + (mBoxes.get(0).mAnimationKind == ANIM_KIND_OPENING && + mBoxes.get(0).mAnimationStartTime != NO_ANIMATION); + } + //////////////////////////////////////////////////////////////////////////// // Layout //////////////////////////////////////////////////////////////////////////// |