diff options
| author | 2023-05-06 00:38:22 +0800 | |
|---|---|---|
| committer | 2023-05-08 15:57:07 +0800 | |
| commit | 77e889f27177a9d4ed856710499ed9e5da3f16e8 (patch) | |
| tree | b3c9b3556e98ef949735746b7209267bc8163c05 | |
| parent | 35f2750e3073a028fba21284858d1e42d231f5b5 (diff) | |
Put change type below closing type for a close transition
Assume a translucent task is closing, the next visible task
may be added to transition participant by collectOrderChanges
as the task is moving to the foreground. Then the transition
info will be {CLOSE, top:CHANGE, bottom:CLOSE}.
So the z-order will be:
numChanges=2
zSplitLine=3
CLOSE=3+2-1=4
CHANGE=3+2-0=5
Then the CLOSE is occluded by the CHANGE incorrectly.
Bug: 281010752
Test: Launch a translucent activity from launcher and it calls
Activity#finishAndRemoveTask(). The activity should not
be covered by the icon on launcher during animation.
Change-Id: I1236946c867abf1b93fca39c4dd9ed114118c051
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java index a73ab776486b..5ca0e992137e 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java @@ -503,7 +503,9 @@ public class Transitions implements RemoteCallable<Transitions>, */ private static void setupAnimHierarchy(@NonNull TransitionInfo info, @NonNull SurfaceControl.Transaction t, @NonNull SurfaceControl.Transaction finishT) { - boolean isOpening = isOpeningType(info.getType()); + final int type = info.getType(); + final boolean isOpening = isOpeningType(type); + final boolean isClosing = isClosingType(type); for (int i = 0; i < info.getRootCount(); ++i) { t.show(info.getRoot(i).getLeash()); } @@ -556,7 +558,13 @@ public class Transitions implements RemoteCallable<Transitions>, layer = zSplitLine + numChanges - i; } } else { // CHANGE or other - layer = zSplitLine + numChanges - i; + if (isClosing) { + // Put below CLOSE mode. + layer = zSplitLine - i; + } else { + // Put above CLOSE mode. + layer = zSplitLine + numChanges - i; + } } t.setLayer(leash, layer); } |