From aff65abe9109d1f465fbd909d76c971694c5b2c9 Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Tue, 13 Mar 2018 09:28:27 -0700 Subject: [PATCH] Hide keyboard after backup passphrase entered Fixes #7508 --- res/layout/enter_backup_passphrase_dialog.xml | 4 ++-- src/org/thoughtcrime/securesms/RegistrationActivity.java | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/res/layout/enter_backup_passphrase_dialog.xml b/res/layout/enter_backup_passphrase_dialog.xml index 656ffd1747..0ace5eb070 100644 --- a/res/layout/enter_backup_passphrase_dialog.xml +++ b/res/layout/enter_backup_passphrase_dialog.xml @@ -8,13 +8,13 @@ android:layout_width="match_parent" android:layout_height="wrap_content"> - + android:inputType="number" /> \ No newline at end of file diff --git a/src/org/thoughtcrime/securesms/RegistrationActivity.java b/src/org/thoughtcrime/securesms/RegistrationActivity.java index 1230f0958a..797e34bb6d 100644 --- a/src/org/thoughtcrime/securesms/RegistrationActivity.java +++ b/src/org/thoughtcrime/securesms/RegistrationActivity.java @@ -30,6 +30,7 @@ import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.animation.OvershootInterpolator; +import android.view.inputmethod.InputMethodManager; import android.widget.ArrayAdapter; import android.widget.EditText; import android.widget.Spinner; @@ -354,6 +355,9 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif .setTitle(R.string.RegistrationActivity_enter_backup_passphrase) .setView(view) .setPositiveButton(getString(R.string.RegistrationActivity_restore), (dialog, which) -> { + InputMethodManager inputMethodManager = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); + inputMethodManager.hideSoftInputFromWindow(prompt.getWindowToken(), 0); + restoreButton.setIndeterminateProgressMode(true); restoreButton.setProgress(50);