Introduce a new Home animation for workspace and the outgoing task.

The values are currently the same for all display and orientation
configurations, but they might change before launch.

There are a couple known imperfections:
* Swiping out of a hotseat app with very low velocity doesn't look
  great
* Sometimes, if the window movement reaches its final location faster
  than the background is done scaling, there is a small snap in icon
  position

Bug: 298089923
Flag: ACONFIG com.android.launcher3.enable_scaling_reveal_home_animation DISABLED
Test: verified with the flag on and off

Change-Id: Id54c7f0a76f62108d8b92a3b5e78634fff64dbef
This commit is contained in:
Luca Zuccarini
2024-03-11 14:29:48 +00:00
parent d640a152cd
commit c9cbc9d5a1
18 changed files with 463 additions and 98 deletions

View File

@@ -43,6 +43,7 @@ import static com.android.launcher3.BaseActivity.INVISIBLE_ALL;
import static com.android.launcher3.BaseActivity.INVISIBLE_BY_APP_TRANSITIONS;
import static com.android.launcher3.BaseActivity.INVISIBLE_BY_PENDING_FLAGS;
import static com.android.launcher3.BaseActivity.PENDING_INVISIBLE_BY_WALLPAPER_ANIMATION;
import static com.android.launcher3.Flags.enableScalingRevealHomeAnimation;
import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY;
import static com.android.launcher3.LauncherAnimUtils.VIEW_BACKGROUND_COLOR;
import static com.android.launcher3.LauncherState.ALL_APPS;
@@ -215,7 +216,8 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
public static final int TASKBAR_TO_APP_DURATION = 600;
// TODO(b/236145847): Tune TASKBAR_TO_HOME_DURATION to 383 after conflict with unlock animation
// is solved.
public static final int TASKBAR_TO_HOME_DURATION = 300;
private static final int TASKBAR_TO_HOME_DURATION_FAST = 300;
private static final int TASKBAR_TO_HOME_DURATION_SLOW = 1000;
protected static final int CONTENT_SCALE_DURATION = 350;
protected static final int CONTENT_SCRIM_DURATION = 350;
@@ -1704,6 +1706,14 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
return new Pair(rectFSpringAnim, anim);
}
public static int getTaskbarToHomeDuration() {
if (enableScalingRevealHomeAnimation()) {
return TASKBAR_TO_HOME_DURATION_SLOW;
} else {
return TASKBAR_TO_HOME_DURATION_FAST;
}
}
/**
* Remote animation runner for animation from the app to Launcher, including recents.
*/