Merge "Track LauncherState for task bar stashing better" into sc-v2-dev

This commit is contained in:
Tracy Zhou
2021-10-19 07:06:14 +00:00
committed by Android (Google) Code Review
4 changed files with 104 additions and 17 deletions

View File

@@ -63,7 +63,7 @@ public class TaskbarStashController {
/**
* How long to stash/unstash when manually invoked via long press.
*/
private static final long TASKBAR_STASH_DURATION = 300;
public static final long TASKBAR_STASH_DURATION = 300;
/**
* The scale TaskbarView animates to when being stashed.
@@ -279,7 +279,12 @@ public class TaskbarStashController {
return false;
}
private Animator createAnimToIsStashed(boolean isStashed, long duration) {
/**
* Create a stash animation and save to {@link #mAnimator}.
* @param isStashed whether it's a stash animation or an unstash animation
* @param duration duration of the animation
*/
private void createAnimToIsStashed(boolean isStashed, long duration) {
if (mAnimator != null) {
mAnimator.cancel();
}
@@ -289,7 +294,7 @@ public class TaskbarStashController {
// Just hide/show the icons instead of stashing into a handle.
mAnimator.play(mIconAlphaForStash.animateToValue(isStashed ? 0 : 1)
.setDuration(duration));
return mAnimator;
return;
}
AnimatorSet fullLengthAnimatorSet = new AnimatorSet();
@@ -361,7 +366,6 @@ public class TaskbarStashController {
mAnimator = null;
}
});
return mAnimator;
}
/**
@@ -481,12 +485,13 @@ public class TaskbarStashController {
boolean isStashed = mStashCondition.test(flags);
if (mIsStashed != isStashed) {
mIsStashed = isStashed;
Animator animator = createAnimToIsStashed(mIsStashed, duration);
createAnimToIsStashed(mIsStashed, duration);
if (start) {
animator.start();
mAnimator.start();
}
return mAnimator;
}
return mAnimator;
return null;
}
}
}