summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2018-04-12 14:16:42 -0700
committerSunny Goyal <sunnygoyal@google.com>2018-04-12 14:17:06 -0700
commitd754dcd5d975f840addce3a149fcc33742404c38 (patch)
tree45a6d94dc97e2d6f6b4e7f8c00dc557d5cd2bd15 /src
parentfd21de44896b4153f91b7b080d7866af4f98af2f (diff)
downloadandroid_packages_apps_Trebuchet-d754dcd5d975f840addce3a149fcc33742404c38.tar.gz
android_packages_apps_Trebuchet-d754dcd5d975f840addce3a149fcc33742404c38.tar.bz2
android_packages_apps_Trebuchet-d754dcd5d975f840addce3a149fcc33742404c38.zip
Only skip the animation, if we are going to the same state
Bug: 77487950 Change-Id: I2d3e376094b0fb0d3120ab6c4d6569f52ab8273f
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/LauncherStateManager.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/com/android/launcher3/LauncherStateManager.java b/src/com/android/launcher3/LauncherStateManager.java
index 01166a15d..e611af7df 100644
--- a/src/com/android/launcher3/LauncherStateManager.java
+++ b/src/com/android/launcher3/LauncherStateManager.java
@@ -173,7 +173,7 @@ public class LauncherStateManager {
onCompleteRunnable.run();
}
return;
- } else if (!mConfig.userControlled && animated) {
+ } else if (!mConfig.userControlled && animated && mConfig.mTargetState == state) {
// We are running the same animation as requested
if (onCompleteRunnable != null) {
mConfig.mCurrentAnimation.addListener(new AnimationSuccessListener() {
@@ -280,7 +280,7 @@ public class LauncherStateManager {
onStateTransitionEnd(state);
}
});
- mConfig.setAnimation(animation);
+ mConfig.setAnimation(animation, state);
return mConfig.mCurrentAnimation;
}
@@ -370,7 +370,7 @@ public class LauncherStateManager {
if (reapplyNeeded) {
reapplyState();
}
- mConfig.setAnimation(anim);
+ mConfig.setAnimation(anim, null);
}
private class StartAnimRunnable implements Runnable {
@@ -401,11 +401,13 @@ public class LauncherStateManager {
private PropertySetter mProperSetter;
private AnimatorSet mCurrentAnimation;
+ private LauncherState mTargetState;
public void reset() {
duration = 0;
userControlled = false;
mProperSetter = null;
+ mTargetState = null;
if (mCurrentAnimation != null) {
mCurrentAnimation.setDuration(0);
@@ -429,8 +431,9 @@ public class LauncherStateManager {
}
}
- public void setAnimation(AnimatorSet animation) {
+ public void setAnimation(AnimatorSet animation, LauncherState targetState) {
mCurrentAnimation = animation;
+ mTargetState = targetState;
mCurrentAnimation.addListener(this);
}
}