File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
app/src/main/java/com/surcumference/fingerprint/view Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -90,9 +90,7 @@ private void initView(Context context) {
9090
9191 withPositiveButtonText (Lang .getString (R .id .ok ));
9292 withOnPositiveButtonClickListener ((dialog , which ) -> {
93- mInputView .clearFocus ();
94- InputMethodManager imm = (InputMethodManager ) getContext ().getSystemService (Context .INPUT_METHOD_SERVICE );
95- imm .hideSoftInputFromWindow (mInputView .getWindowToken (), 0 );
93+ hideInputMethod ();
9694 post (() -> {
9795 dialog .dismiss ();
9896 });
@@ -123,6 +121,12 @@ protected void onAttachedToWindow() {
123121 imm .showSoftInput (mInputView , InputMethodManager .SHOW_IMPLICIT );
124122 }, 200 );
125123 }
124+ public void hideInputMethod () {
125+ mInputView .clearFocus ();
126+ InputMethodManager imm = (InputMethodManager ) getContext ().getSystemService (Context .INPUT_METHOD_SERVICE );
127+ imm .hideSoftInputFromWindow (mInputView .getWindowToken (), 0 );
128+ }
129+
126130
127131 @ Override
128132 public AlertDialog showInDialog () {
Original file line number Diff line number Diff line change @@ -187,6 +187,7 @@ private void showUpdatePasswordViewDialog() {
187187 passwordInputView .setDefaultText (DEFAULT_HIDDEN_PASS );
188188 }
189189 passwordInputView .withOnPositiveButtonClickListener ((dialog , which ) -> {
190+ passwordInputView .hideInputMethod ();
190191 String inputText = passwordInputView .getInput ();
191192 if (TextUtils .isEmpty (inputText )) {
192193 config .setPasswordEncrypted ("" );
You can’t perform that action at this time.
0 commit comments