From 3c3b07e3a1511e736d5629c2bc4573d34c48f3ec Mon Sep 17 00:00:00 2001 From: Yuli Huang Date: Wed, 16 May 2012 01:38:06 +0800 Subject: Fix card effect shown in opening animation. bug:6495753 Change-Id: I7a640c2dddef0b7c58e0b7d5a00cbc4aab6ec43d --- src/com/android/gallery3d/ui/PositionController.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/com/android/gallery3d/ui/PositionController.java') 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 //////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3