Merge "Dispatch onAnimationStart and End to maintain proper state" into tm-qpr-dev am: 8baae80cdf

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21150244

Change-Id: I463f969d05b6e26e8d69cd906674a9c6a92be611
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2023-02-01 20:47:39 +00:00
committed by Automerger Merge Worker

View File

@@ -240,6 +240,7 @@ public class AllSetActivity extends Activity {
maybeResumeOrPauseBackgroundAnimation();
if (mSwipeProgress.value >= 1) {
finishAndRemoveTask();
dispatchLauncherAnimStartEnd();
}
}
@@ -251,6 +252,18 @@ public class AllSetActivity extends Activity {
}
}
/**
* Should be called when we have successfully reached Launcher, so we dispatch to animation
* listeners to ensure the state matches the visual animation that just occurred.
*/
private void dispatchLauncherAnimStartEnd() {
if (mLauncherStartAnim != null) {
mLauncherStartAnim.dispatchOnStart();
mLauncherStartAnim.dispatchOnEnd();
mLauncherStartAnim = null;
}
}
@Override
protected void onDestroy() {
super.onDestroy();
@@ -259,6 +272,7 @@ public class AllSetActivity extends Activity {
if (mBackgroundAnimatorListener != null) {
mAnimatedBackground.removeAnimatorListener(mBackgroundAnimatorListener);
}
dispatchLauncherAnimStartEnd();
}
private AnimatedFloat createSwipeUpProxy(GestureState state) {