Merge "Add missing call to finish the home animation" into sc-dev am: 9b45bce963

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

Change-Id: I3035f8f9176c97e3b28d82d25969b9ddf3d74b33
This commit is contained in:
Winson Chung
2021-05-27 00:20:11 +00:00
committed by Automerger Merge Worker
@@ -82,6 +82,7 @@ import com.android.launcher3.DeviceProfile;
import com.android.launcher3.R; import com.android.launcher3.R;
import com.android.launcher3.Utilities; import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimationSuccessListener; import com.android.launcher3.anim.AnimationSuccessListener;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.logging.StatsLogManager; import com.android.launcher3.logging.StatsLogManager;
import com.android.launcher3.logging.StatsLogManager.StatsLogger; import com.android.launcher3.logging.StatsLogManager.StatsLogger;
import com.android.launcher3.statemanager.BaseState; import com.android.launcher3.statemanager.BaseState;
@@ -1214,20 +1215,22 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
&& (windowRotation == ROTATION_90 || windowRotation == ROTATION_270)) { && (windowRotation == ROTATION_90 || windowRotation == ROTATION_270)) {
swipePipToHomeAnimator.setFromRotation(mTaskViewSimulator, windowRotation); swipePipToHomeAnimator.setFromRotation(mTaskViewSimulator, windowRotation);
} }
AnimatorPlaybackController activityAnimationToHome =
homeAnimFactory.createActivityAnimationToHome();
swipePipToHomeAnimator.addListener(new AnimatorListenerAdapter() { swipePipToHomeAnimator.addListener(new AnimatorListenerAdapter() {
private boolean mHasAnimationEnded; private boolean mHasAnimationEnded;
@Override @Override
public void onAnimationStart(Animator animation) { public void onAnimationStart(Animator animation) {
if (mHasAnimationEnded) return; if (mHasAnimationEnded) return;
// Ensure Launcher ends in NORMAL state, we intentionally skip other callbacks // Ensure Launcher ends in NORMAL state
// since they are not relevant in this swipe-pip-to-home case. activityAnimationToHome.dispatchOnStart();
homeAnimFactory.createActivityAnimationToHome().dispatchOnStart();
} }
@Override @Override
public void onAnimationEnd(Animator animation) { public void onAnimationEnd(Animator animation) {
if (mHasAnimationEnded) return; if (mHasAnimationEnded) return;
mHasAnimationEnded = true; mHasAnimationEnded = true;
activityAnimationToHome.getAnimationPlayer().end();
if (mRecentsAnimationController == null) { if (mRecentsAnimationController == null) {
// If the recents animation is interrupted, we still end the running // If the recents animation is interrupted, we still end the running
// animation (not canceled) so this is still called. In that case, we can // animation (not canceled) so this is still called. In that case, we can