Desktop Mode Taskbar Recreate Animation

This Cl includes
       - addition of entry/exit callback methods in DesktopVisibilityController.
       - taskbar manager now listens to desktop mode changes.
       - TaskbarBackrgroundRedererer can now individually animation backgrounds for transient and persistent taskbars
       - new channel for taskbar icon alpha added to TaskbarViewController
       - new animated float to handle background alpha while we are recreating taskbar with animation.

Solution:

we use the callabck we get from DekstopVisibilty for entry/exit to first change logic of when we are considered inDesktopMode. Upon entry/exit we notify display controller for info change.
we also at notify taskbar manager who is now a listener to the desktop mode change and start the recreate process. TaskbarManager first animates existing taskbar out of user view and then follows the original recreate flow.

Test: Presubmit
Bug: 343882478
Flag: com.android.window.flags.enable_desktop_windowing_mode
Change-Id: Ib827564cacd194f499e7d9b1965e2bb13e3548ab
This commit is contained in:
Jagrut Desai committed 2025-02-24 11:59:53 -08:00
1 parent 332c329276
commit 8b2e5eff9b
19 files changed
+458 -86

No files matched your search

@@ -223,9 +223,13 @@ public class TaskbarLauncherStateController {
updateStateForFlag(FLAG_LAUNCHER_IN_STATE_TRANSITION, true);
if (!mShouldDelayLauncherStateAnim) {
if (toState == LauncherState.NORMAL) {
applyState(QuickstepTransitionManager.getTaskbarToHomeDuration(
boolean isPinnedTaskbarAndNotInDesktopMode =
DisplayController.isPinnedTaskbar(
mControllers.taskbarActivityContext)));
mControllers.taskbarActivityContext)
&& !DisplayController.isInDesktopMode(
mControllers.taskbarActivityContext);
applyState(QuickstepTransitionManager.getTaskbarToHomeDuration(
isPinnedTaskbarAndNotInDesktopMode));
} else {
applyState();
}
@@ -680,8 +684,11 @@ public class TaskbarLauncherStateController {
} else if (mIconAlignment.isAnimatingToValue(toAlignment)
|| mIconAlignment.isSettledOnValue(toAlignment)) {
// Already at desired value, but make sure we run the callback at the end.
animatorSet.addListener(AnimatorListeners.forEndCallback(
this::onIconAlignmentRatioChanged));
animatorSet.addListener(AnimatorListeners.forEndCallback(() -> {
if (!mIconAlignment.isAnimating()) {
onIconAlignmentRatioChanged();
}
}));
} else {
mIconAlignment.cancelAnimation();
ObjectAnimator iconAlignAnim = mIconAlignment