summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Evan Rosky <erosky@google.com> 2023-05-10 18:22:11 -0700
committer Evan Rosky <erosky@google.com> 2023-05-10 18:22:11 -0700
commitef06550fb9b7da0df6b76017f034b824c66a20c8 (patch)
treee3c75b482832c13841c9afcdf1e95a0100aa0cb6
parentbbfaff3024613ac82dbde54ec440b2e200718670 (diff)
Swap z-order of tasks for default wallpaper-open animation
the defaulthandler's wallpaper-open animation reverses the normal closing/opening task dynamic: normally we animate OPEN as the opening-task appearing over closing; however, for the wallpaper-open case (which presumably assumes that the "opening" task is a 3p launcher), we actually animate the closing task closing over the opening-task. This requires the z-order to be swapped. Bug: 279680678 Test: use 3p launcher and 3-button nav. open an app. press "home" button. Change-Id: I37362c1ade5ee786ed93b0544d37b6b38a549f04
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java
index 21dca95d056a..6a2468a7eaa2 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java
@@ -435,6 +435,23 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {
backgroundColorForTransition =
uiContext.getColor(R.color.overview_background);
}
+ if (wallpaperTransit == WALLPAPER_TRANSITION_OPEN
+ && TransitionUtil.isOpeningType(info.getType())) {
+ // Need to flip the z-order of opening/closing because the WALLPAPER_OPEN
+ // always animates the closing task over the opening one while
+ // traditionally, an OPEN transition animates the opening over the closing.
+
+ // See Transitions#setupAnimHierarchy for details about these variables.
+ final int numChanges = info.getChanges().size();
+ final int zSplitLine = numChanges + 1;
+ if (TransitionUtil.isOpeningType(mode)) {
+ final int layer = zSplitLine - i;
+ startTransaction.setLayer(change.getLeash(), layer);
+ } else if (TransitionUtil.isClosingType(mode)) {
+ final int layer = zSplitLine + numChanges - i;
+ startTransaction.setLayer(change.getLeash(), layer);
+ }
+ }
}
final float cornerRadius;