summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ming-Shin Lu <lumark@google.com> 2023-06-09 09:30:17 +0000
committer Ming-Shin Lu <lumark@google.com> 2023-06-09 10:03:58 +0000
commit652bf9fe2a153d9ba9d54d4416557eedecb901d0 (patch)
tree544756757e5aaf63736b2e3e9d7ccd9bf8b670b8
parent7502484675309a42b56187a7008ab664918f762e (diff)
Fix the split divider position being shifted during animating
When swiping up the split-task to the overview with the recents transition, the split divider will have 2 layers leash: Transition leash divider leash divider surface The issue happens when the transition leash created by transition, TransitionUtil will init its position with the current divider leash requested position, and set the divider leash position with (0, 0). Even it's OK if there is no other divider position chaning during the transition, but when split-screen with IME showing case, swiping up to the overview will make the IME hidden and onImePositionChaning will let divider leash modify its position to take down position, which causes the divider position ends up being double offseted from the transition and the divider leash. Fix this double offset issue with - initial divider transition leash with (0, 0) - avoid setting divider leash position when creating the target. See: http://recall/-/f4Af82nZWqQjebShRA9NM9/dOJACJwL8QrnDdUSuta17z Fix: 286349215 Test: manual with issue steps: 0) open 2 apps with entering to split-screen 1) tap the navigation bar to trigger the recents transition, observe the divider position stays the same without being shifted. 2) Show IME, verify the divider hidden and the task position adjusted 3) Swipe up split-screen task with IME to the overview, expects IME hidden and the task positon adjusted back. 4) Bring the split-screen task back to foreground. 5) Obeserve the divider position if it stays in the right place. Change-Id: I5762ccf96645aeb8b9fd07ae3ffa1044a56548c5
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/util/TransitionUtil.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/util/TransitionUtil.java b/libs/WindowManager/Shell/src/com/android/wm/shell/util/TransitionUtil.java
index 143b42a1ec96..893111100919 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/util/TransitionUtil.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/util/TransitionUtil.java
@@ -171,6 +171,9 @@ public class TransitionUtil {
if (isOpeningType(mode)) {
t.setAlpha(leash, 0.f);
}
+ // Set the transition leash position to 0 in case the divider leash position being
+ // taking down.
+ t.setPosition(leash, 0, 0);
t.setLayer(leash, Integer.MAX_VALUE);
return;
}
@@ -229,7 +232,11 @@ public class TransitionUtil {
t.reparent(change.getLeash(), leashSurface);
t.setAlpha(change.getLeash(), 1.0f);
t.show(change.getLeash());
- t.setPosition(change.getLeash(), 0, 0);
+ if (!isDividerBar(change)) {
+ // For divider, don't modify its inner leash position when creating the outer leash
+ // for the transition. In case the position being wrong after the transition finished.
+ t.setPosition(change.getLeash(), 0, 0);
+ }
t.setLayer(change.getLeash(), 0);
return leashSurface;
}