Don't reapply state when setting user controlled animation
Bug: 79525106
Change-Id: Ia41a51559196d4aa657fae47727c7366d9073295
diff --git a/src/com/android/launcher3/LauncherStateManager.java b/src/com/android/launcher3/LauncherStateManager.java
index d04401e..cf0c7fc 100644
--- a/src/com/android/launcher3/LauncherStateManager.java
+++ b/src/com/android/launcher3/LauncherStateManager.java
@@ -387,6 +387,7 @@
}
public void setCurrentUserControlledAnimation(AnimatorPlaybackController controller) {
+ clearCurrentAnimation();
setCurrentAnimation(controller.getTarget());
mConfig.userControlled = true;
mConfig.playbackController = controller;
@@ -405,15 +406,10 @@
}
if (mConfig.playbackController != null
&& mConfig.playbackController.getTarget() == childAnim) {
- if (mConfig.mCurrentAnimation != null) {
- mConfig.mCurrentAnimation.removeListener(mConfig);
- mConfig.mCurrentAnimation = null;
- }
- mConfig.playbackController = null;
+ clearCurrentAnimation();
break;
} else if (mConfig.mCurrentAnimation == childAnim) {
- mConfig.mCurrentAnimation.removeListener(mConfig);
- mConfig.mCurrentAnimation = null;
+ clearCurrentAnimation();
break;
}
}
@@ -425,6 +421,14 @@
mConfig.setAnimation(anim, null);
}
+ private void clearCurrentAnimation() {
+ if (mConfig.mCurrentAnimation != null) {
+ mConfig.mCurrentAnimation.removeListener(mConfig);
+ mConfig.mCurrentAnimation = null;
+ }
+ mConfig.playbackController = null;
+ }
+
private class StartAnimRunnable implements Runnable {
private final AnimatorSet mAnim;