Synchronize the app launch and taskbar stash animations.

Introduce FLAG_IGNORE_IN_APP to prevent taskbar from stashing prematurely
due to HomeTransitionListener signal.

Bug: 345768019
Fixes: 319162553
Test: Launch an app, note the two animations are synced
      Verified by locally introducing a startDelay (since otherwise it is hard to tell)
Flag: com.android.launcher3.enable_scaling_reveal_home_animation
Change-Id: Ibb64e0321f33cf81e337fc7c1b2c3edfb23e6ba4
This commit is contained in:
Jon Miranda
2024-07-17 15:17:08 -07:00
parent 2397ffd437
commit cde962dcb7
3 changed files with 48 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ import static com.android.launcher3.QuickstepTransitionManager.TRANSIENT_TASKBAR
import static com.android.launcher3.statemanager.BaseState.FLAG_NON_INTERACTIVE;
import static com.android.launcher3.taskbar.TaskbarEduTooltipControllerKt.TOOLTIP_STEP_FEATURES;
import static com.android.launcher3.taskbar.TaskbarLauncherStateController.FLAG_VISIBLE;
import static com.android.launcher3.taskbar.TaskbarStashController.FLAG_IGNORE_IN_APP;
import static com.android.quickstep.TaskAnimationManager.ENABLE_SHELL_TRANSITIONS;
import static com.android.window.flags.Flags.enableDesktopWindowingWallpaperActivity;
@@ -256,6 +257,24 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
return mTaskbarLauncherStateController.createAnimToLauncher(toState, callbacks, duration);
}
/**
* Create Taskbar animation to be played alongside the Launcher app launch animation.
*/
public @Nullable Animator createAnimToApp() {
TaskbarStashController stashController = mControllers.taskbarStashController;
stashController.updateStateForFlag(TaskbarStashController.FLAG_IN_APP, true);
return stashController.createApplyStateAnimator(stashController.getStashDuration());
}
/**
* Temporarily ignore FLAG_IN_APP for app launches to prevent premature taskbar stashing.
* This is needed because taskbar gets a signal to stash before we actually start the
* app launch animation.
*/
public void setIgnoreInAppFlagForSync(boolean enabled) {
mControllers.taskbarStashController.updateStateForFlag(FLAG_IGNORE_IN_APP, enabled);
}
public void updateTaskbarLauncherStateGoingHome() {
mTaskbarLauncherStateController.updateStateForFlag(FLAG_VISIBLE, true);
mTaskbarLauncherStateController.applyState();