Loading quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +5 −2 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import static com.android.launcher3.config.FeatureFlags.enableTaskbarPinning; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_OPEN; import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_DRAGGING; import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_FULLSCREEN; import static com.android.launcher3.taskbar.TaskbarStashController.SHOULD_BUBBLES_FOLLOW_DEFAULT_VALUE; import static com.android.launcher3.testing.shared.ResourceUtils.getBoolByName; import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR; import static com.android.quickstep.util.AnimUtils.completeRunnableListCallback; Loading Loading @@ -1550,10 +1551,12 @@ public class TaskbarActivityContext extends BaseTaskbarContext { /** * Called when we want to unstash taskbar when user performs swipes up gesture. * @param delayTaskbarBackground whether we will delay the taskbar background animation */ public void onSwipeToUnstashTaskbar() { public void onSwipeToUnstashTaskbar(boolean delayTaskbarBackground) { boolean wasStashed = mControllers.taskbarStashController.isStashed(); mControllers.taskbarStashController.updateAndAnimateTransientTaskbar(/* stash= */ false); mControllers.taskbarStashController.updateAndAnimateTransientTaskbar(/* stash= */ false, SHOULD_BUBBLES_FOLLOW_DEFAULT_VALUE, delayTaskbarBackground); boolean isStashed = mControllers.taskbarStashController.isStashed(); if (isStashed != wasStashed) { VibratorWrapper.INSTANCE.get(this).vibrateForTaskbarUnstash(); Loading quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java +56 −20 Original line number Diff line number Diff line Loading @@ -82,6 +82,11 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba private static final String TAG = "TaskbarStashController"; private static final boolean DEBUG = false; /** * Def. value for @param shouldBubblesFollow in * {@link #updateAndAnimateTransientTaskbar(boolean)} */ public static boolean SHOULD_BUBBLES_FOLLOW_DEFAULT_VALUE = true; public static final int FLAG_IN_APP = 1 << 0; public static final int FLAG_STASHED_IN_APP_SYSUI = 1 << 1; // shade open, ... public static final int FLAG_STASHED_IN_APP_SETUP = 1 << 2; // setup wizard and AllSetActivity Loading @@ -94,6 +99,8 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba public static final int FLAG_STASHED_SYSUI = 1 << 9; // app pinning,... public static final int FLAG_STASHED_DEVICE_LOCKED = 1 << 10; // device is locked: keyguard, ... public static final int FLAG_IN_OVERVIEW = 1 << 11; // launcher is in overview // An internal no-op flag to determine whether we should delay the taskbar background animation private static final int FLAG_DELAY_TASKBAR_BG_TAG = 1 << 12; // If any of these flags are enabled, isInApp should return true. private static final int FLAGS_IN_APP = FLAG_IN_APP | FLAG_IN_SETUP; Loading Loading @@ -489,9 +496,17 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba /** * Stash or unstashes the transient taskbar, using the default TASKBAR_STASH_DURATION. * If bubble bar exists, it will match taskbars stashing behavior. * Will not delay taskbar background by default. */ public void updateAndAnimateTransientTaskbar(boolean stash) { updateAndAnimateTransientTaskbar(stash, /* shouldBubblesFollow= */ true); updateAndAnimateTransientTaskbar(stash, SHOULD_BUBBLES_FOLLOW_DEFAULT_VALUE, false); } /** * Stash or unstashes the transient taskbar, using the default TASKBAR_STASH_DURATION. */ public void updateAndAnimateTransientTaskbar(boolean stash, boolean shouldBubblesFollow) { updateAndAnimateTransientTaskbar(stash, shouldBubblesFollow, false); } /** Loading @@ -499,14 +514,15 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba * * @param stash whether transient taskbar should be stashed. * @param shouldBubblesFollow whether bubbles should match taskbars behavior. * @param delayTaskbarBackground whether we will delay the taskbar background animation */ public void updateAndAnimateTransientTaskbar(boolean stash, boolean shouldBubblesFollow) { public void updateAndAnimateTransientTaskbar(boolean stash, boolean shouldBubblesFollow, boolean delayTaskbarBackground) { if (!DisplayController.isTransientTaskbar(mActivity)) { return; } if ( stash if (stash && !mControllers.taskbarAutohideSuspendController .isSuspendedForTransientTaskbarInLauncher() && mControllers.taskbarAutohideSuspendController Loading @@ -515,12 +531,30 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba return; } boolean shouldApplyState = false; if (delayTaskbarBackground) { mControllers.taskbarStashController.updateStateForFlag(FLAG_DELAY_TASKBAR_BG_TAG, true); shouldApplyState = true; } if (hasAnyFlag(FLAG_STASHED_IN_APP_AUTO) != stash) { mTaskbarSharedState.taskbarWasStashedAuto = stash; updateStateForFlag(FLAG_STASHED_IN_APP_AUTO, stash); shouldApplyState = true; } if (shouldApplyState) { applyState(); } // Effectively a no-opp to remove the tag. if (delayTaskbarBackground) { mControllers.taskbarStashController.updateStateForFlag(FLAG_DELAY_TASKBAR_BG_TAG, false); mControllers.taskbarStashController.applyState(0); } mControllers.bubbleControllers.ifPresent(controllers -> { if (shouldBubblesFollow) { final boolean willStash = mIsStashedPredicate.test(mState); Loading Loading @@ -587,11 +621,11 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba * @param isStashed whether it's a stash animation or an unstash animation * @param duration duration of the animation * @param animationType what transition type to play. * @param skipTaskbarBackgroundDelay Iff true, skips delaying the taskbar background. * @param shouldDelayBackground whether we should delay the taskbar bg animation * @param jankTag tag to be used in jank monitor trace. */ private void createAnimToIsStashed(boolean isStashed, long duration, @StashAnimation int animationType, boolean skipTaskbarBackgroundDelay, String jankTag) { @StashAnimation int animationType, boolean shouldDelayBackground, String jankTag) { if (animationType == TRANSITION_UNSTASH_SUW_MANUAL && isStashed) { // The STASH_ANIMATION_SUW_MANUAL must only be used during an unstash animation. Log.e(TAG, "Illegal arguments:Using TRANSITION_UNSTASH_SUW_MANUAL to stash taskbar"); Loading Loading @@ -630,7 +664,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba if (isTransientTaskbar) { createTransientAnimToIsStashed(mAnimator, isStashed, duration, skipTaskbarBackgroundDelay, animationType); shouldDelayBackground, animationType); } else { createAnimToIsStashed(mAnimator, isStashed, duration, stashTranslation, animationType); } Loading Loading @@ -736,7 +770,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba } private void createTransientAnimToIsStashed(AnimatorSet as, boolean isStashed, long duration, boolean skipTaskbarBackgroundDelay, @StashAnimation int animationType) { boolean shouldDelayBackground, @StashAnimation int animationType) { // Target values of the properties this is going to set final float backgroundOffsetTarget = isStashed ? 1 : 0; final float iconAlphaTarget = isStashed ? 0 : 1; Loading Loading @@ -787,7 +821,10 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba backgroundAndHandleAlphaStartDelay, backgroundAndHandleAlphaDuration, LINEAR); if (enableScalingRevealHomeAnimation() && isStashed && !skipTaskbarBackgroundDelay) { if (enableScalingRevealHomeAnimation() && !isStashed && shouldDelayBackground) { play(as, getTaskbarBackgroundAnimatorWhenNotGoingHome(duration), 0, 0, LINEAR); as.addListener(AnimatorListeners.forEndCallback( Loading Loading @@ -1349,10 +1386,9 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba mIsStashed = isStashed; mLastStartedTransitionType = animationType; boolean skipTaskbarBgDelay = !hasAnyFlag(FLAG_STASHED_IN_TASKBAR_ALL_APPS) && hasAnyFlag(FLAG_STASHED_IN_TASKBAR_ALL_APPS, changedFlags); boolean shouldDelayBackground = hasAnyFlag(FLAG_DELAY_TASKBAR_BG_TAG); // This sets mAnimator. createAnimToIsStashed(mIsStashed, duration, animationType, skipTaskbarBgDelay, createAnimToIsStashed(mIsStashed, duration, animationType, shouldDelayBackground, computeTaskbarJankMonitorTag(changedFlags)); return mAnimator; } Loading quickstep/src/com/android/quickstep/inputconsumers/TaskbarUnstashInputConsumer.java +3 −3 Original line number Diff line number Diff line Loading @@ -184,7 +184,7 @@ public class TaskbarUnstashInputConsumer extends DelegateInputConsumer { if (!mHasPassedTaskbarNavThreshold && passedTaskbarNavThreshold && !mGestureState.isInExtendedSlopRegion()) { mHasPassedTaskbarNavThreshold = true; mTaskbarActivityContext.onSwipeToUnstashTaskbar(); mTaskbarActivityContext.onSwipeToUnstashTaskbar(true); } if (dY < 0) { Loading Loading @@ -287,7 +287,7 @@ public class TaskbarUnstashInputConsumer extends DelegateInputConsumer { // start a single unstash timeout if hovering bottom edge under the hinted taskbar. if (!sUnstashHandler.hasMessagesOrCallbacks()) { sUnstashHandler.postDelayed(() -> { mTaskbarActivityContext.onSwipeToUnstashTaskbar(); mTaskbarActivityContext.onSwipeToUnstashTaskbar(false); mIsStashedTaskbarHovered = false; }, HOVER_TASKBAR_UNSTASH_TIMEOUT); } Loading Loading @@ -315,7 +315,7 @@ public class TaskbarUnstashInputConsumer extends DelegateInputConsumer { startStashedTaskbarHover(/* isHovered = */ true); } else if (mBottomEdgeBounds.contains(x, y)) { // If hover screen's bottom edge not below the stashed taskbar, unstash it. mTaskbarActivityContext.onSwipeToUnstashTaskbar(); mTaskbarActivityContext.onSwipeToUnstashTaskbar(false); } } Loading Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +5 −2 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import static com.android.launcher3.config.FeatureFlags.enableTaskbarPinning; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_OPEN; import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_DRAGGING; import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_FULLSCREEN; import static com.android.launcher3.taskbar.TaskbarStashController.SHOULD_BUBBLES_FOLLOW_DEFAULT_VALUE; import static com.android.launcher3.testing.shared.ResourceUtils.getBoolByName; import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR; import static com.android.quickstep.util.AnimUtils.completeRunnableListCallback; Loading Loading @@ -1550,10 +1551,12 @@ public class TaskbarActivityContext extends BaseTaskbarContext { /** * Called when we want to unstash taskbar when user performs swipes up gesture. * @param delayTaskbarBackground whether we will delay the taskbar background animation */ public void onSwipeToUnstashTaskbar() { public void onSwipeToUnstashTaskbar(boolean delayTaskbarBackground) { boolean wasStashed = mControllers.taskbarStashController.isStashed(); mControllers.taskbarStashController.updateAndAnimateTransientTaskbar(/* stash= */ false); mControllers.taskbarStashController.updateAndAnimateTransientTaskbar(/* stash= */ false, SHOULD_BUBBLES_FOLLOW_DEFAULT_VALUE, delayTaskbarBackground); boolean isStashed = mControllers.taskbarStashController.isStashed(); if (isStashed != wasStashed) { VibratorWrapper.INSTANCE.get(this).vibrateForTaskbarUnstash(); Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java +56 −20 Original line number Diff line number Diff line Loading @@ -82,6 +82,11 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba private static final String TAG = "TaskbarStashController"; private static final boolean DEBUG = false; /** * Def. value for @param shouldBubblesFollow in * {@link #updateAndAnimateTransientTaskbar(boolean)} */ public static boolean SHOULD_BUBBLES_FOLLOW_DEFAULT_VALUE = true; public static final int FLAG_IN_APP = 1 << 0; public static final int FLAG_STASHED_IN_APP_SYSUI = 1 << 1; // shade open, ... public static final int FLAG_STASHED_IN_APP_SETUP = 1 << 2; // setup wizard and AllSetActivity Loading @@ -94,6 +99,8 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba public static final int FLAG_STASHED_SYSUI = 1 << 9; // app pinning,... public static final int FLAG_STASHED_DEVICE_LOCKED = 1 << 10; // device is locked: keyguard, ... public static final int FLAG_IN_OVERVIEW = 1 << 11; // launcher is in overview // An internal no-op flag to determine whether we should delay the taskbar background animation private static final int FLAG_DELAY_TASKBAR_BG_TAG = 1 << 12; // If any of these flags are enabled, isInApp should return true. private static final int FLAGS_IN_APP = FLAG_IN_APP | FLAG_IN_SETUP; Loading Loading @@ -489,9 +496,17 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba /** * Stash or unstashes the transient taskbar, using the default TASKBAR_STASH_DURATION. * If bubble bar exists, it will match taskbars stashing behavior. * Will not delay taskbar background by default. */ public void updateAndAnimateTransientTaskbar(boolean stash) { updateAndAnimateTransientTaskbar(stash, /* shouldBubblesFollow= */ true); updateAndAnimateTransientTaskbar(stash, SHOULD_BUBBLES_FOLLOW_DEFAULT_VALUE, false); } /** * Stash or unstashes the transient taskbar, using the default TASKBAR_STASH_DURATION. */ public void updateAndAnimateTransientTaskbar(boolean stash, boolean shouldBubblesFollow) { updateAndAnimateTransientTaskbar(stash, shouldBubblesFollow, false); } /** Loading @@ -499,14 +514,15 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba * * @param stash whether transient taskbar should be stashed. * @param shouldBubblesFollow whether bubbles should match taskbars behavior. * @param delayTaskbarBackground whether we will delay the taskbar background animation */ public void updateAndAnimateTransientTaskbar(boolean stash, boolean shouldBubblesFollow) { public void updateAndAnimateTransientTaskbar(boolean stash, boolean shouldBubblesFollow, boolean delayTaskbarBackground) { if (!DisplayController.isTransientTaskbar(mActivity)) { return; } if ( stash if (stash && !mControllers.taskbarAutohideSuspendController .isSuspendedForTransientTaskbarInLauncher() && mControllers.taskbarAutohideSuspendController Loading @@ -515,12 +531,30 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba return; } boolean shouldApplyState = false; if (delayTaskbarBackground) { mControllers.taskbarStashController.updateStateForFlag(FLAG_DELAY_TASKBAR_BG_TAG, true); shouldApplyState = true; } if (hasAnyFlag(FLAG_STASHED_IN_APP_AUTO) != stash) { mTaskbarSharedState.taskbarWasStashedAuto = stash; updateStateForFlag(FLAG_STASHED_IN_APP_AUTO, stash); shouldApplyState = true; } if (shouldApplyState) { applyState(); } // Effectively a no-opp to remove the tag. if (delayTaskbarBackground) { mControllers.taskbarStashController.updateStateForFlag(FLAG_DELAY_TASKBAR_BG_TAG, false); mControllers.taskbarStashController.applyState(0); } mControllers.bubbleControllers.ifPresent(controllers -> { if (shouldBubblesFollow) { final boolean willStash = mIsStashedPredicate.test(mState); Loading Loading @@ -587,11 +621,11 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba * @param isStashed whether it's a stash animation or an unstash animation * @param duration duration of the animation * @param animationType what transition type to play. * @param skipTaskbarBackgroundDelay Iff true, skips delaying the taskbar background. * @param shouldDelayBackground whether we should delay the taskbar bg animation * @param jankTag tag to be used in jank monitor trace. */ private void createAnimToIsStashed(boolean isStashed, long duration, @StashAnimation int animationType, boolean skipTaskbarBackgroundDelay, String jankTag) { @StashAnimation int animationType, boolean shouldDelayBackground, String jankTag) { if (animationType == TRANSITION_UNSTASH_SUW_MANUAL && isStashed) { // The STASH_ANIMATION_SUW_MANUAL must only be used during an unstash animation. Log.e(TAG, "Illegal arguments:Using TRANSITION_UNSTASH_SUW_MANUAL to stash taskbar"); Loading Loading @@ -630,7 +664,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba if (isTransientTaskbar) { createTransientAnimToIsStashed(mAnimator, isStashed, duration, skipTaskbarBackgroundDelay, animationType); shouldDelayBackground, animationType); } else { createAnimToIsStashed(mAnimator, isStashed, duration, stashTranslation, animationType); } Loading Loading @@ -736,7 +770,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba } private void createTransientAnimToIsStashed(AnimatorSet as, boolean isStashed, long duration, boolean skipTaskbarBackgroundDelay, @StashAnimation int animationType) { boolean shouldDelayBackground, @StashAnimation int animationType) { // Target values of the properties this is going to set final float backgroundOffsetTarget = isStashed ? 1 : 0; final float iconAlphaTarget = isStashed ? 0 : 1; Loading Loading @@ -787,7 +821,10 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba backgroundAndHandleAlphaStartDelay, backgroundAndHandleAlphaDuration, LINEAR); if (enableScalingRevealHomeAnimation() && isStashed && !skipTaskbarBackgroundDelay) { if (enableScalingRevealHomeAnimation() && !isStashed && shouldDelayBackground) { play(as, getTaskbarBackgroundAnimatorWhenNotGoingHome(duration), 0, 0, LINEAR); as.addListener(AnimatorListeners.forEndCallback( Loading Loading @@ -1349,10 +1386,9 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba mIsStashed = isStashed; mLastStartedTransitionType = animationType; boolean skipTaskbarBgDelay = !hasAnyFlag(FLAG_STASHED_IN_TASKBAR_ALL_APPS) && hasAnyFlag(FLAG_STASHED_IN_TASKBAR_ALL_APPS, changedFlags); boolean shouldDelayBackground = hasAnyFlag(FLAG_DELAY_TASKBAR_BG_TAG); // This sets mAnimator. createAnimToIsStashed(mIsStashed, duration, animationType, skipTaskbarBgDelay, createAnimToIsStashed(mIsStashed, duration, animationType, shouldDelayBackground, computeTaskbarJankMonitorTag(changedFlags)); return mAnimator; } Loading
quickstep/src/com/android/quickstep/inputconsumers/TaskbarUnstashInputConsumer.java +3 −3 Original line number Diff line number Diff line Loading @@ -184,7 +184,7 @@ public class TaskbarUnstashInputConsumer extends DelegateInputConsumer { if (!mHasPassedTaskbarNavThreshold && passedTaskbarNavThreshold && !mGestureState.isInExtendedSlopRegion()) { mHasPassedTaskbarNavThreshold = true; mTaskbarActivityContext.onSwipeToUnstashTaskbar(); mTaskbarActivityContext.onSwipeToUnstashTaskbar(true); } if (dY < 0) { Loading Loading @@ -287,7 +287,7 @@ public class TaskbarUnstashInputConsumer extends DelegateInputConsumer { // start a single unstash timeout if hovering bottom edge under the hinted taskbar. if (!sUnstashHandler.hasMessagesOrCallbacks()) { sUnstashHandler.postDelayed(() -> { mTaskbarActivityContext.onSwipeToUnstashTaskbar(); mTaskbarActivityContext.onSwipeToUnstashTaskbar(false); mIsStashedTaskbarHovered = false; }, HOVER_TASKBAR_UNSTASH_TIMEOUT); } Loading Loading @@ -315,7 +315,7 @@ public class TaskbarUnstashInputConsumer extends DelegateInputConsumer { startStashedTaskbarHover(/* isHovered = */ true); } else if (mBottomEdgeBounds.contains(x, y)) { // If hover screen's bottom edge not below the stashed taskbar, unstash it. mTaskbarActivityContext.onSwipeToUnstashTaskbar(); mTaskbarActivityContext.onSwipeToUnstashTaskbar(false); } } Loading