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

Commit cf9a927c authored by Felix Stern's avatar Felix Stern
Browse files

Fix: Hiding IME via predictiveBack and focussing editText did not show it

Dismissing the IME (by swiping back) and immediately refocusing the text input field (for example by clicking on it) did not work during the hide animation. Taps on the input field were ignored as long as the hide animation was running.
This CL fixes that, as in the predictiveBack case, we won't ignore the new show request anymore.


Change-Id: I5629d0782a4eca42bdea514d726fbeaebf6d3f05
Test: Swipe back on predictiveBack enabled view; focus editText during hiding animation
Bug: 375989651
Flag: android.view.inputmethod.refactor_insets_controller
parent 1fecbb95
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1083,7 +1083,7 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
        }
    }

    boolean isPredictiveBackImeHideAnimInProgress() {
    public boolean isPredictiveBackImeHideAnimInProgress() {
        return mIsPredictiveBackImeHideAnimInProgress;
    }

+8 −4
Original line number Diff line number Diff line
@@ -2400,10 +2400,14 @@ public final class InputMethodManager {
            if (Flags.refactorInsetsController()) {
                final var viewRootImpl = view.getViewRootImpl();
                // In case of a running show IME animation, it should not be requested visible,
                // otherwise the animation would jump and not be controlled by the user anymore
                if (viewRootImpl != null
                        && (viewRootImpl.getInsetsController().computeUserAnimatingTypes()
                                & WindowInsets.Type.ime()) == 0) {
                // otherwise the animation would jump and not be controlled by the user anymore.
                // If predictive back is in progress, and a editText is focussed, we should
                // show the IME.
                if (viewRootImpl != null && (
                        (viewRootImpl.getInsetsController().computeUserAnimatingTypes()
                                & WindowInsets.Type.ime()) == 0
                        || viewRootImpl.getInsetsController()
                                .isPredictiveBackImeHideAnimInProgress())) {
                    ImeTracker.forLogging().onProgress(statsToken,
                            ImeTracker.PHASE_CLIENT_NO_ONGOING_USER_ANIMATION);
                    if (resultReceiver != null) {