Merge "End any running taskbar animation in cleanup()" into sc-dev am: 43e516227e

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifb0462a868534c702cdc2688bf58d2af90cac089
This commit is contained in:
TreeHugger Robot authored and Automerger Merge Worker committed 2021-03-10 15:19:24 +00:00
commit 2d09993fd9
1 file changed
+19 -6
@@ -85,6 +85,7 @@ public class TaskbarController {
// Contains all loaded Hotseat items.
private ItemInfo[] mLatestLoadedHotseatItems;
private @Nullable Animator mAnimator;
private boolean mIsAnimatingToLauncher;
public TaskbarController(BaseQuickstepLauncher launcher,
@@ -252,6 +253,10 @@ public class TaskbarController {
mTaskbarVisibilityController.cleanup();
mHotseatController.cleanup();
mRecentsController.cleanup();
if (mAnimator != null) {
mAnimator.end();
}
}
private void removeFromWindowManager() {
@@ -294,13 +299,21 @@ public class TaskbarController {
*/
public void onLauncherResumedOrPaused(boolean isResumed) {
long duration = QuickstepAppTransitionManagerImpl.CONTENT_ALPHA_DURATION;
final Animator anim;
if (isResumed) {
anim = createAnimToLauncher(null, duration);
} else {
anim = createAnimToApp(duration);
if (mAnimator != null) {
mAnimator.cancel();
}
anim.start();
if (isResumed) {
mAnimator = createAnimToLauncher(null, duration);
} else {
mAnimator = createAnimToApp(duration);
}
mAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
mAnimator = null;
}
});
mAnimator.start();
}
/**