Merge "End any running taskbar animation in cleanup()" into sc-dev

This commit is contained in:
TreeHugger Robot
2021-03-09 22:58:39 +00:00
committed by Android (Google) Code Review

View File

@@ -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();
}
/**