Hide keyboard after backup passphrase entered

Fixes #7508
This commit is contained in:
Moxie Marlinspike 2018-03-13 09:28:27 -07:00
parent 64afce5f66
commit aff65abe91
2 changed files with 6 additions and 2 deletions

View File

@ -8,13 +8,13 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<AutoCompleteTextView <android.support.design.widget.TextInputEditText
android:id="@+id/restore_passphrase_input" android:id="@+id/restore_passphrase_input"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/enter_backup_passphrase_dialog__backup_passphrase" android:hint="@string/enter_backup_passphrase_dialog__backup_passphrase"
android:imeOptions="actionDone" android:imeOptions="actionDone"
android:inputType="textVisiblePassword" /> android:inputType="number" />
</android.support.design.widget.TextInputLayout> </android.support.design.widget.TextInputLayout>
</FrameLayout> </FrameLayout>

View File

@ -30,6 +30,7 @@ import android.view.LayoutInflater;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.view.animation.OvershootInterpolator; import android.view.animation.OvershootInterpolator;
import android.view.inputmethod.InputMethodManager;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.EditText; import android.widget.EditText;
import android.widget.Spinner; import android.widget.Spinner;
@ -354,6 +355,9 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif
.setTitle(R.string.RegistrationActivity_enter_backup_passphrase) .setTitle(R.string.RegistrationActivity_enter_backup_passphrase)
.setView(view) .setView(view)
.setPositiveButton(getString(R.string.RegistrationActivity_restore), (dialog, which) -> { .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.setIndeterminateProgressMode(true);
restoreButton.setProgress(50); restoreButton.setProgress(50);