Skip to content
Snippets Groups Projects
Commit d755668b authored by akwizgran's avatar akwizgran
Browse files

Close soft keyboard in SetupActivity.

parent eaff0426
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@ import static android.view.View.GONE;
import static android.view.View.INVISIBLE;
import static android.view.View.VISIBLE;
import static android.view.WindowManager.LayoutParams.FLAG_SECURE;
import static android.view.inputmethod.InputMethodManager.HIDE_IMPLICIT_ONLY;
import static android.widget.LinearLayout.VERTICAL;
import static java.util.logging.Level.INFO;
import static org.briarproject.android.TestingConstants.PREVENT_SCREENSHOTS;
......@@ -43,16 +44,20 @@ import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Bundle;
import android.text.Editable;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.TextView.OnEditorActionListener;
public class SetupActivity extends RoboActivity implements OnClickListener {
public class SetupActivity extends RoboActivity implements OnClickListener,
OnEditorActionListener {
private static final Logger LOG =
Logger.getLogger(SetupActivity.class.getName());
......@@ -142,6 +147,7 @@ public class SetupActivity extends RoboActivity implements OnClickListener {
passwordConfirmation.setMaxLines(1);
inputType = TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_PASSWORD;
passwordConfirmation.setInputType(inputType);
passwordConfirmation.setOnEditorActionListener(this);
layout.addView(passwordConfirmation);
strengthMeter = new StrengthMeter(this);
......@@ -213,6 +219,13 @@ public class SetupActivity extends RoboActivity implements OnClickListener {
return c;
}
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
// Hide the soft keyboard
Object o = getSystemService(INPUT_METHOD_SERVICE);
((InputMethodManager) o).toggleSoftInput(HIDE_IMPLICIT_ONLY, 0);
return true;
}
public void onClick(View view) {
// Replace the feedback text and button with a progress bar
feedback.setVisibility(GONE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment