Merge "Request hiding IME before starting next activity transition"
This commit is contained in:
committed by
Android (Google) Code Review
commit
425b87090f
@@ -954,6 +954,9 @@ public class ChooseLockPassword extends SettingsActivity {
|
||||
return;
|
||||
}
|
||||
|
||||
ConfirmDeviceCredentialUtils.hideImeImmediately(
|
||||
getActivity().getWindow().getDecorView());
|
||||
|
||||
mPasswordEntryInputDisabler.setInputEnabled(false);
|
||||
setNextEnabled(false);
|
||||
|
||||
|
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -493,6 +493,9 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
|
||||
}
|
||||
|
||||
private void startDisappearAnimation(final Intent intent) {
|
||||
ConfirmDeviceCredentialUtils.hideImeImmediately(
|
||||
getActivity().getWindow().getDecorView());
|
||||
|
||||
if (mDisappearing) {
|
||||
return;
|
||||
}
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user