summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/launcher3/Workspace.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 3c6ab317a..ad045ccf4 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -289,6 +289,7 @@ public class Workspace extends SmoothPagedView
private float[] mNewAlphas;
private int mLastChildCount = -1;
private float mTransitionProgress;
+ private Animator mStateAnimator = null;
float mOverScrollEffect = 0f;
@@ -2341,6 +2342,13 @@ public class Workspace extends SmoothPagedView
AnimatorSet anim = animated ? LauncherAnimUtils.createAnimatorSet() : null;
+ // We only want a single instance of a workspace animation to be running at once, so
+ // we cancel any incomplete transition.
+ if (mStateAnimator != null) {
+ mStateAnimator.cancel();
+ }
+ mStateAnimator = anim;
+
final State oldState = mState;
final boolean oldStateIsNormal = (oldState == State.NORMAL);
final boolean oldStateIsSpringLoaded = (oldState == State.SPRING_LOADED);
@@ -2627,6 +2635,12 @@ public class Workspace extends SmoothPagedView
anim.play(hotseatAlpha);
anim.play(pageIndicatorAlpha);
anim.setStartDelay(delay);
+ anim.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ mStateAnimator = null;
+ }
+ });
} else {
overviewPanel.setAlpha(finalOverviewPanelAlpha);
AlphaUpdateListener.updateVisibility(overviewPanel);