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

Commit 3070e77f authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Fix a few issues with ime adjust/minimized dock stack

- Do not override minimized state in SysUI when IME adjust change
comes in.
- Do not animate IME adjust if we are already animating for minimized.
This lead to problems that we animated the minimized state with the IME
adjust values.
- Make sure to update state after checking whether the IME adjust is
animating. This is to fix an issue where sometimes the IME adjust
animation didn't run because the old target was wrong.

Change-Id: Ie35e2f943a4cda99ffdc6f14663d892863759e46
Fixes: 28819201
parent 3bed1c0e
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -169,12 +169,14 @@ public class Divider extends SystemUI {
                if (mAdjustedForIme != adjustedForIme) {
                    mAdjustedForIme = adjustedForIme;
                    updateTouchable();
                    if (!mMinimized) {
                        if (animDuration > 0) {
                            mView.setAdjustedForIme(adjustedForIme, animDuration);
                        } else {
                            mView.setAdjustedForIme(adjustedForIme);
                        }
                    }
                }
            });
        }

+3 −3
Original line number Diff line number Diff line
@@ -300,7 +300,7 @@ public class DockedStackDividerController implements DimLayerUser {
            boolean animate, WindowState imeWin, int imeHeight) {
        if (mAdjustedForIme != adjustedForIme || (adjustedForIme && mImeHeight != imeHeight)
                || mAdjustedForDivider != adjustedForDivider) {
            if (animate) {
            if (animate && !mAnimatingForMinimizedDockedStack) {
                startImeAdjustAnimation(adjustedForIme, adjustedForDivider, imeWin);
            } else {
                // Animation might be delayed, so only notify if we don't run an animation.
@@ -547,8 +547,6 @@ public class DockedStackDividerController implements DimLayerUser {

    private void startImeAdjustAnimation(
            boolean adjustedForIme, boolean adjustedForDivider, WindowState imeWin) {
        mAnimatingForIme = true;
        mAnimationStarted = false;

        // If we're not in an animation, the starting point depends on whether we're adjusted
        // or not. If we're already in an animation, we start from where the current animation
@@ -562,6 +560,8 @@ public class DockedStackDividerController implements DimLayerUser {
            mAnimationStart = mLastAnimationProgress;
            mDividerAnimationStart = mLastDividerProgress;
        }
        mAnimatingForIme = true;
        mAnimationStarted = false;
        mAnimationTarget = adjustedForIme ? 1 : 0;
        mDividerAnimationTarget = adjustedForDivider ? 1 : 0;