From 1bd4bf7ff17cb76332a3e3cee94042d300b9a0b9 Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Thu, 7 Oct 2021 18:33:43 -0700 Subject: [PATCH] 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 --- .../taskbar/TaskbarStashController.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java index 295472b996..6d6f0f2e00 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java @@ -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() {