Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bcc316ed authored by lumark's avatar lumark
Browse files

Refine UI janky in split-screen when launch & close IME opened app

In split-screen mode, when launching the IME focused app on bottom stack,
there are 2 animations will be triggered to resize the bottom stack:

1) dock_bottom_enter transition animation start will trigger DividerView in
SysUi to resize stack & translate divider which animates from up to bottom.
2) stack resize animation for IME adjustment done by DockedStackDividerController
the direction is from bottom to up.

So it will possible cause screen flicking due to task moving in different way.

Set no animate to skip frames for 1) & make sure the enter transition animation
not running when starting IME adjust animation to fix this issue.

Bug: 118364779
Test: manual, in split-screen mode:
     1) Launch app (i.e. chrome app) on bottom stack.
     2) Tap EditText to show keyboard.
     3) Press home key & launch the same app again.
     4) Verify if animation goes well.

Change-Id: I60875554e4b7df3cbdd0241d29d5685a97ecc27c
parent b0eab4fa
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -396,6 +396,10 @@ public class DockedStackDividerController {
        if (mAdjustedForIme != adjustedForIme || (adjustedForIme && mImeHeight != imeHeight)
                || mAdjustedForDivider != adjustedForDivider) {
            if (animate && !mAnimatingForMinimizedDockedStack) {
                // Notify SystemUI to set the target docked stack size according current docked
                // state without animation when calling startImeAdjustAnimation.
                notifyDockedStackMinimizedChanged(mMinimizedDock, false /* animate */,
                        isHomeStackResizable());
                startImeAdjustAnimation(adjustedForIme, adjustedForDivider, imeWin);
            } else {
                // Animation might be delayed, so only notify if we don't run an animation.
@@ -889,7 +893,10 @@ public class DockedStackDividerController {
        }
        if (mAnimatingForMinimizedDockedStack) {
            return animateForMinimizedDockedStack(now);
        } else if (mAnimatingForIme) {
        } else if (mAnimatingForIme && !mDisplayContent.mAppTransition.isRunning()) {
            // To prevent task stack resize animation may flicking when playing app transition
            // animation & IME window enter animation in parallel, make sure app transition is done
            // and then start to animate for IME.
            return animateForIme(now);
        }
        return false;
+8 −0
Original line number Diff line number Diff line
@@ -1163,6 +1163,14 @@ public class TaskStack extends WindowContainer<Task> implements
    }

    private boolean adjustForIME(final WindowState imeWin) {
        // To prevent task stack resize animation may flicking when playing app transition
        // animation & IME window enter animation in parallel, we need to make sure app
        // transition is done and then adjust task size for IME, skip the new adjusted frame when
        // app transition is still running.
        if (getDisplayContent().mAppTransition.isRunning()) {
            return false;
        }

        final int dockedSide = getDockSide();
        final boolean dockedTopOrBottom = dockedSide == DOCKED_TOP || dockedSide == DOCKED_BOTTOM;
        if (imeWin == null || !dockedTopOrBottom) {