mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 10:48:19 +00:00
Merge "End any running taskbar animation in cleanup()" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
43e516227e
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user