summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/ui/PositionController.java
diff options
context:
space:
mode:
authorYuli Huang <yuli@google.com>2012-05-16 01:38:06 +0800
committerYuli Huang <yuli@google.com>2012-05-16 16:38:17 +0800
commit3c3b07e3a1511e736d5629c2bc4573d34c48f3ec (patch)
treef4a2a76525a09f474171171add0c6edd4317da80 /src/com/android/gallery3d/ui/PositionController.java
parent4fa3d5bb57d166d915225b60e9f659e9c91fb9b3 (diff)
downloadandroid_packages_apps_Snap-3c3b07e3a1511e736d5629c2bc4573d34c48f3ec.tar.gz
android_packages_apps_Snap-3c3b07e3a1511e736d5629c2bc4573d34c48f3ec.tar.bz2
android_packages_apps_Snap-3c3b07e3a1511e736d5629c2bc4573d34c48f3ec.zip
Fix card effect shown in opening animation.
bug:6495753 Change-Id: I7a640c2dddef0b7c58e0b7d5a00cbc4aab6ec43d
Diffstat (limited to 'src/com/android/gallery3d/ui/PositionController.java')
-rw-r--r--src/com/android/gallery3d/ui/PositionController.java16
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
////////////////////////////////////////////////////////////////////////////