summaryrefslogtreecommitdiff
path: root/src/com/android/browser/HttpAuthenticationDialog.java
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2011-02-28 17:52:53 -0800
committerJohn Reck <jreck@google.com>2011-02-28 17:52:53 -0800
commite8872c79fb8993c194a229e59cccb11d82fb6c76 (patch)
tree15063d6215c8839aa5c3ffc886d9eba4fa61508e /src/com/android/browser/HttpAuthenticationDialog.java
parenta9496e1ab66fda87ea406f31d5ec4a213e0b6307 (diff)
Make enter advance navigation or sign in
Bug: 3487066 Also cleaned up the layout Change-Id: Iaa471ff8fcd793381cb98416493dcf707cbecc29
Diffstat (limited to 'src/com/android/browser/HttpAuthenticationDialog.java')
-rw-r--r--src/com/android/browser/HttpAuthenticationDialog.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/com/android/browser/HttpAuthenticationDialog.java b/src/com/android/browser/HttpAuthenticationDialog.java
index a9ba332e..ac4119c0 100644
--- a/src/com/android/browser/HttpAuthenticationDialog.java
+++ b/src/com/android/browser/HttpAuthenticationDialog.java
@@ -18,10 +18,13 @@ package com.android.browser;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
+import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
+import android.view.inputmethod.EditorInfo;
import android.widget.TextView;
+import android.widget.TextView.OnEditorActionListener;
/**
* HTTP authentication dialog.
@@ -109,6 +112,16 @@ public class HttpAuthenticationDialog {
View v = factory.inflate(R.layout.http_authentication, null);
mUsernameView = (TextView) v.findViewById(R.id.username_edit);
mPasswordView = (TextView) v.findViewById(R.id.password_edit);
+ mPasswordView.setOnEditorActionListener(new OnEditorActionListener() {
+ @Override
+ public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+ if (actionId == EditorInfo.IME_ACTION_DONE) {
+ mDialog.getButton(AlertDialog.BUTTON_POSITIVE).performClick();
+ return true;
+ }
+ return false;
+ }
+ });
String title = mContext.getText(R.string.sign_in_to).toString().replace(
"%s1", mHost).replace("%s2", mRealm);