diff options
author | Michael Jurka <mikejurka@google.com> | 2010-10-28 15:36:06 -0700 |
---|---|---|
committer | Michael Jurka <mikejurka@google.com> | 2010-10-29 14:52:03 -0700 |
commit | 3c4c20fbe682cb4b3ef94f09afe0af09171583f3 (patch) | |
tree | 12b89327b982535153b97ba77ce720e54b439260 /src/com/android/launcher2/CellLayout.java | |
parent | cd68ff5b88de9b5136ff5a9ef698e4db2fc5db66 (diff) | |
download | android_packages_apps_Trebuchet-3c4c20fbe682cb4b3ef94f09afe0af09171583f3.tar.gz android_packages_apps_Trebuchet-3c4c20fbe682cb4b3ef94f09afe0af09171583f3.tar.bz2 android_packages_apps_Trebuchet-3c4c20fbe682cb4b3ef94f09afe0af09171583f3.zip |
Fix: switching states during animations was broken
- cancelling state animations on home screens before starting new ones
- temporary workaround for the fact that onAnimationEnd is not called immediately when an animation is cancelled
- forcing all apps zoom-in animation to complete if it's cancelled
Change-Id: I3eb011f689050692e8d95f2736e01ab5420f722e
Diffstat (limited to 'src/com/android/launcher2/CellLayout.java')
-rw-r--r-- | src/com/android/launcher2/CellLayout.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java index 95c976ba8..66d5cb500 100644 --- a/src/com/android/launcher2/CellLayout.java +++ b/src/com/android/launcher2/CellLayout.java @@ -16,7 +16,7 @@ package com.android.launcher2; -import java.util.Arrays; +import com.android.launcher.R; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; @@ -26,7 +26,6 @@ import android.animation.TimeInterpolator; import android.animation.ValueAnimator; import android.animation.ValueAnimator.AnimatorUpdateListener; import android.app.WallpaperManager; -import android.content.ClipDescription; import android.content.Context; import android.content.res.Resources; import android.content.res.TypedArray; @@ -42,7 +41,6 @@ import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.util.Log; import android.view.ContextMenu; -import android.view.DragEvent; import android.view.MotionEvent; import android.view.View; import android.view.ViewDebug; @@ -51,7 +49,7 @@ import android.view.animation.Animation; import android.view.animation.DecelerateInterpolator; import android.view.animation.LayoutAnimationController; -import com.android.launcher.R; +import java.util.Arrays; public class CellLayout extends ViewGroup implements Dimmable { static final String TAG = "CellLayout"; @@ -245,6 +243,7 @@ public class CellLayout extends ViewGroup implements Dimmable { // The animation holds a reference to the drag outline bitmap as long is it's // running. This way the bitmap can be GCed when the animations are complete. anim.getAnimator().addListener(new AnimatorListenerAdapter() { + @Override public void onAnimationEnd(Animator animation) { if ((Float) ((ValueAnimator) animation).getAnimatedValue() == 0f) { anim.setTag(null); @@ -305,11 +304,13 @@ public class CellLayout extends ViewGroup implements Dimmable { AnimatorSet bouncer = new AnimatorSet(); bouncer.play(scaleUp).before(scaleDown); bouncer.play(scaleUp).with(alphaFadeOut); - bouncer.addListener(new AnimatorListenerAdapter() { + bouncer.addListener(new LauncherAnimatorListenerAdapter() { + @Override public void onAnimationStart(Animator animation) { setHover(true); } - public void onAnimationEnd(Animator animation) { + @Override + public void onAnimationEndOrCancel(Animator animation) { setHover(false); setHoverScale(1.0f); setHoverAlpha(1.0f); |