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
@@ -95,6 +95,7 @@ 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
public static final int FLAG_IGNORE_IN_APP = 1 << 12; // used to sync with app launch animation
// If any of these flags are enabled, isInApp should return true.
private static final int FLAGS_IN_APP = FLAG_IN_APP | FLAG_IN_SETUP;
@@ -1263,6 +1264,11 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
*/
@Nullable
public Animator createSetStateAnimator(long flags, long duration) {
// We do this when we want to synchronize the app launch and taskbar stash animations.
if (hasAnyFlag(FLAG_IGNORE_IN_APP) && hasAnyFlag(flags, FLAG_IN_APP)) {
flags = flags & ~FLAG_IN_APP;
}
boolean isStashed = mStashCondition.test(flags);
if (DEBUG) {