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

Commit 425b8709 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Request hiding IME before starting next activity transition"

parents 39c9441b 526d5c69
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -954,6 +954,9 @@ public class ChooseLockPassword extends SettingsActivity {
                return;
            }

            ConfirmDeviceCredentialUtils.hideImeImmediately(
                    getActivity().getWindow().getDecorView());

            mPasswordEntryInputDisabler.setInputEnabled(false);
            setNextEnabled(false);

+17 −0
Original line number Diff line number Diff line
@@ -25,6 +25,11 @@ import android.content.Intent;
import android.content.IntentSender;
import android.os.RemoteException;
import android.os.UserManager;
import android.view.View;
import android.view.WindowInsets;
import android.view.WindowInsetsController;

import androidx.annotation.NonNull;

import com.android.internal.widget.LockPatternUtils;

@@ -67,4 +72,16 @@ public class ConfirmDeviceCredentialUtils {
            utils.userPresent(userId);
        }
    }

    /**
     * Request hiding soft-keyboard before animating away credential UI, in case IME
     * insets animation get delayed by dismissing animation.
     * @param view used to get root {@link WindowInsets} and {@link WindowInsetsController}.
     */
    public static void hideImeImmediately(@NonNull View view) {
        if (view.isAttachedToWindow()
                && view.getRootWindowInsets().isVisible(WindowInsets.Type.ime())) {
            view.getWindowInsetsController().hide(WindowInsets.Type.ime());
        }
    }
}
+3 −0
Original line number Diff line number Diff line
@@ -493,6 +493,9 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
        }

        private void startDisappearAnimation(final Intent intent) {
            ConfirmDeviceCredentialUtils.hideImeImmediately(
                    getActivity().getWindow().getDecorView());

            if (mDisappearing) {
                return;
            }
+2 −4
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;

import androidx.annotation.Nullable;
@@ -121,9 +120,8 @@ public class SetupChooseLockPassword extends ChooseLockPassword {
                        forFace,
                        forBiometrics);

                InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(
                        Context.INPUT_METHOD_SERVICE);
                imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
                ConfirmDeviceCredentialUtils.hideImeImmediately(
                        getActivity().getWindow().getDecorView());

                dialog.show(getFragmentManager());
                return;