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

Commit 93ea15a5 authored by Tarandeep Singh's avatar Tarandeep Singh
Browse files

Prevent Insets side visibility change during animation

If app requests to show IME as soon as app resumes, the animation is
prepared and IME window is set visibile/invisible at start of the
animation. Also, control is set to the window when it receives focus.
This results in control showing the IME before even animation starts
creating a flicker.
Solution is to not applyVisibility when control is set if IME (or
another side) is already animating.

Fix: 144503524
Test: Manually using steps in bug.
      atest InsetsControllerTest InsetsSourceConsumerTest

Change-Id: I5271d906772510cd819f75dc8eed141f4248b34f
parent 4aeff5ba
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -467,6 +467,10 @@ public class InsetsController implements WindowInsetsController {
        }
    }

    boolean isAnimating() {
        return mAnimationDirection != DIRECTION_NONE;
    }

    private InsetsSourceConsumer createConsumerOfType(int type) {
        if (type == ITYPE_IME) {
            return new ImeInsetsSourceConsumer(mState, Transaction::new, this);
@@ -514,6 +518,7 @@ public class InsetsController implements WindowInsetsController {
                } else {
                    hideDirectly(types);
                }
                mAnimationDirection = show ? DIRECTION_SHOW : DIRECTION_HIDE;
                mAnimator = ObjectAnimator.ofObject(
                        controller,
                        new InsetsProperty(),
+2 −1
Original line number Diff line number Diff line
@@ -167,7 +167,8 @@ public class InsetsSourceConsumer {
    }

    private void applyHiddenToControl() {
        if (mSourceControl == null || mSourceControl.getLeash() == null) {
        if (mSourceControl == null || mSourceControl.getLeash() == null
                || mController.isAnimating()) {
            return;
        }