When taskbar would be stashed in 3 button mode, hide icons instead

In 0 button mode, stashing morphs the icons into the home handle. In 3 button mode, that doesn't make sense, but we should still hide the icons (and just keep the 3 nav buttons). You still can't manually stash via long press in 3 button mode, but this will address other states where we automatically stash the taskbar when we want to hide the icons from users (e.g. when pinning an app).

Test: Pin an app from overview in 3 button mode, ensure the taskbar icons disappear until unpinning
Bug: 190192993
Change-Id: I499c59bd9d7871ff64696b67065cf9d4863222a5
This commit is contained in:
Tony Wickham committed 2021-10-07 23:29:41 -07:00
1 parent db0c2f1b79
commit 1bd4bf7ff1
1 file changed
+12 -7
@@ -115,9 +115,6 @@ public class TaskbarStashController {
// Evaluate whether the handle should be stashed
private final StatePropertyHolder mStatePropertyHolder = new StatePropertyHolder(
flags -> {
if (!supportsVisualStashing()) {
return false;
}
boolean inApp = hasAnyFlag(flags, FLAG_IN_APP);
boolean stashedInApp = hasAnyFlag(flags, FLAGS_STASHED_IN_APP);
boolean stashedLauncherState = hasAnyFlag(flags, FLAG_IN_STASHED_LAUNCHER_STATE);
@@ -244,6 +241,18 @@ public class TaskbarStashController {
}
private Animator createAnimToIsStashed(boolean isStashed, long duration) {
if (mAnimator != null) {
mAnimator.cancel();
}
mAnimator = new AnimatorSet();
if (!supportsVisualStashing()) {
// Just hide/show the icons instead of stashing into a handle.
mAnimator.play(mIconAlphaForStash.animateToValue(isStashed ? 0 : 1)
.setDuration(duration));
return mAnimator;
}
AnimatorSet fullLengthAnimatorSet = new AnimatorSet();
// Not exactly half and may overlap. See [first|second]HalfDurationScale below.
AnimatorSet firstHalfAnimatorSet = new AnimatorSet();
@@ -299,10 +308,6 @@ public class TaskbarStashController {
secondHalfAnimatorSet.setDuration((long) (duration * secondHalfDurationScale));
secondHalfAnimatorSet.setStartDelay((long) (duration * (1 - secondHalfDurationScale)));
if (mAnimator != null) {
mAnimator.cancel();
}
mAnimator = new AnimatorSet();
mAnimator.playTogether(fullLengthAnimatorSet, firstHalfAnimatorSet,
secondHalfAnimatorSet);
mAnimator.addListener(new AnimatorListenerAdapter() {