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

@@ -356,6 +356,14 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
options.setOnAnimationAbortListener(endCallback);
options.setOnAnimationFinishedListener(endCallback);
// Prepare taskbar for animation synchronization. This needs to happen here before any
// app transition is created.
LauncherTaskbarUIController taskbarController = mLauncher.getTaskbarUIController();
if (enableScalingRevealHomeAnimation() && taskbarController != null) {
taskbarController.setIgnoreInAppFlagForSync(true);
onEndCallback.add(() -> taskbarController.setIgnoreInAppFlagForSync(false));
}
IBinder cookie = mAppLaunchRunner.supportsReturnTransition()
? ((ContainerAnimationRunner) mAppLaunchRunner).getCookie() : null;
addLaunchCookie(cookie, (ItemInfo) v.getTag(), options);
@@ -1912,6 +1920,21 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
anim.addListener(mForceInvisibleListener);
}
// Syncs the app launch animation and taskbar stash animation (if exists).
if (enableScalingRevealHomeAnimation()) {
LauncherTaskbarUIController taskbarController = mLauncher.getTaskbarUIController();
if (taskbarController != null) {
taskbarController.setIgnoreInAppFlagForSync(false);
if (launcherClosing) {
Animator taskbar = taskbarController.createAnimToApp();
if (taskbar != null) {
anim.play(taskbar);
}
}
}
}
result.setAnimation(anim, mLauncher, mOnEndCallback::executeAllAndDestroy,
skipFirstFrame);
}