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

Commit 4be737a4 authored by Tony Huang's avatar Tony Huang Committed by Automerger Merge Worker
Browse files

Merge "Start IME animation if its insets update after show" into rvc-dev am:...

Merge "Start IME animation if its insets update after show" into rvc-dev am: 8ebf215f am: 3e6c27c8 am: 4a59fcac

Change-Id: I232a806ad82de071113e429e21b267b1af569494
parents 552d51c2 4a59fcac
Loading
Loading
Loading
Loading
+9 −7
Original line number Original line Diff line number Diff line
@@ -211,14 +211,16 @@ public class Divider extends SystemUI implements DividerView.DividerCallbacks,
            mTargetShown = imeShouldShow;
            mTargetShown = imeShouldShow;
            if (mLastAdjustTop < 0) {
            if (mLastAdjustTop < 0) {
                mLastAdjustTop = imeShouldShow ? hiddenTop : shownTop;
                mLastAdjustTop = imeShouldShow ? hiddenTop : shownTop;
            } else {
            } else if (mLastAdjustTop != (imeShouldShow ? mShownTop : mHiddenTop)) {
                // Check for an "interruption" of an existing animation. In this case, we need to
                // fake-flip the last-known state direction so that the animation completes in the
                // other direction.
                if (mTargetAdjusted != targetAdjusted && targetAdjusted == mAdjusted) {
                if (mTargetAdjusted != targetAdjusted && targetAdjusted == mAdjusted) {
                    if (mLastAdjustTop != (imeShouldShow ? mShownTop : mHiddenTop)) {
                    // Check for an "interruption" of an existing animation. In this case, we
                    // need to fake-flip the last-known state direction so that the animation
                    // completes in the other direction.
                    mAdjusted = mTargetAdjusted;
                    mAdjusted = mTargetAdjusted;
                    }
                } else if (targetAdjusted && mTargetAdjusted && mAdjusted) {
                    // Already fully adjusted for IME, but IME height has changed; so, force-start
                    // an async animation to the new IME height.
                    mAdjusted = false;
                }
                }
            }
            }
            if (mPaused) {
            if (mPaused) {
+10 −0
Original line number Original line Diff line number Diff line
@@ -21,6 +21,7 @@ import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator;
import android.content.res.Configuration;
import android.content.res.Configuration;
import android.graphics.Point;
import android.graphics.Point;
import android.graphics.Rect;
import android.os.Handler;
import android.os.Handler;
import android.os.RemoteException;
import android.os.RemoteException;
import android.util.Slog;
import android.util.Slog;
@@ -188,7 +189,16 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged
            if (mInsetsState.equals(insetsState)) {
            if (mInsetsState.equals(insetsState)) {
                return;
                return;
            }
            }

            final InsetsSource newSource = insetsState.getSource(InsetsState.ITYPE_IME);
            final Rect newFrame = newSource.getFrame();
            final Rect oldFrame = mInsetsState.getSource(InsetsState.ITYPE_IME).getFrame();

            mInsetsState.set(insetsState, true /* copySources */);
            mInsetsState.set(insetsState, true /* copySources */);
            if (mImeShowing && !newFrame.equals(oldFrame) && newSource.isVisible()) {
                if (DEBUG) Slog.d(TAG, "insetsChanged when IME showing, restart animation");
                startAnimation(mImeShowing, true /* forceRestart */);
            }
        }
        }


        @Override
        @Override