diff options
author | Michael Kolb <kolby@google.com> | 2010-08-10 17:52:34 -0700 |
---|---|---|
committer | Michael Kolb <kolby@google.com> | 2010-08-13 10:29:05 -0700 |
commit | ed217745066c160f785626e9a15ebe70af5e25e4 (patch) | |
tree | 963a7f797a48b40d2f57d43288f918e25d157c3f /src/com/android/browser/UrlInputView.java | |
parent | 8b139744c1138351fb8e3fff280cf45dd056fa85 (diff) | |
download | packages_apps_Browser-ed217745066c160f785626e9a15ebe70af5e25e4.zip packages_apps_Browser-ed217745066c160f785626e9a15ebe70af5e25e4.tar.gz packages_apps_Browser-ed217745066c160f785626e9a15ebe70af5e25e4.tar.bz2 |
switched to using action bar for large screen
Change-Id: I33b6bcd78d4983e0ce1b503d3756687588dd8ed0
Diffstat (limited to 'src/com/android/browser/UrlInputView.java')
-rw-r--r-- | src/com/android/browser/UrlInputView.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/com/android/browser/UrlInputView.java b/src/com/android/browser/UrlInputView.java index f564d6a..77d7daf 100644 --- a/src/com/android/browser/UrlInputView.java +++ b/src/com/android/browser/UrlInputView.java @@ -35,13 +35,14 @@ import android.widget.CursorAdapter; import android.widget.Filterable; import android.widget.ImageView; import android.widget.TextView; +import android.widget.TextView.OnEditorActionListener; /** * url/search input view * handling suggestions */ public class UrlInputView extends AutoCompleteTextView - implements OnFocusChangeListener, OnItemClickListener { + implements OnFocusChangeListener, OnItemClickListener, OnEditorActionListener { private UrlInputListener mListener; private InputMethodManager mInputManager; @@ -66,13 +67,7 @@ public class UrlInputView extends AutoCompleteTextView private void init(Context ctx) { mFocusDrawable = ctx.getResources().getDrawable(R.drawable.textfield_stroke); mInputManager = (InputMethodManager) ctx.getSystemService(Context.INPUT_METHOD_SERVICE); - setOnEditorActionListener(new OnEditorActionListener() { - @Override - public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { - finishInput(getText().toString()); - return true; - } - }); + setOnEditorActionListener(this); setOnFocusChangeListener(this); final ContentResolver cr = mContext.getContentResolver(); mAdapter = new SuggestionsAdapter(mContext, @@ -83,6 +78,12 @@ public class UrlInputView extends AutoCompleteTextView } @Override + public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { + finishInput(getText().toString()); + return true; + } + + @Override public void onFocusChange(View v, boolean hasFocus) { setBackgroundDrawable(hasFocus ? mFocusDrawable : null); if (hasFocus) { |