diff options
| author | Narayan Kamath <narayan@google.com> | 2011-02-23 12:01:13 +0000 |
|---|---|---|
| committer | Narayan Kamath <narayan@google.com> | 2011-03-02 18:10:21 +0000 |
| commit | 80aad8d851601d39f73214c198111ca49e25f654 (patch) | |
| tree | f0f859bcd85f8f203243404165034038637e75a5 /src/com/android/browser/UrlInputView.java | |
| parent | 2eb1190bdda1d2d53c049aa3f5000af6a150e2ca (diff) | |
Add autocomplete to the browser UrlInputView.
Code and tests based on the google search app. A lot
less code would be duplicated if we could somehow
override AutoCompleteTextView but that is made impossible
by it calling a bunch of stuff in its constructor. To do
so would require changes to the existing API.
I've verified that the unit test passes, but other browser
tests appear to fail - even on a clean branch with none
of my changes.
Also fixes a minor bug in SearchEngines.getSearchableInfo( ).
Change-Id: Ic61bc6b8fa27cd210a45dc181ebf15accf503244
Diffstat (limited to 'src/com/android/browser/UrlInputView.java')
| -rw-r--r-- | src/com/android/browser/UrlInputView.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/com/android/browser/UrlInputView.java b/src/com/android/browser/UrlInputView.java index 2ec21111..362e941b 100644 --- a/src/com/android/browser/UrlInputView.java +++ b/src/com/android/browser/UrlInputView.java @@ -18,6 +18,7 @@ package com.android.browser; import com.android.browser.SuggestionsAdapter.CompletionListener; import com.android.browser.SuggestionsAdapter.SuggestItem; +import com.android.browser.autocomplete.SuggestiveAutoCompleteTextView; import com.android.browser.search.SearchEngine; import com.android.browser.search.SearchEngineInfo; import com.android.browser.search.SearchEngines; @@ -32,7 +33,6 @@ import android.view.View; import android.view.inputmethod.InputMethodManager; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; -import android.widget.AutoCompleteTextView; import android.widget.TextView; import android.widget.TextView.OnEditorActionListener; @@ -42,7 +42,7 @@ import java.util.List; * url/search input view * handling suggestions */ -public class UrlInputView extends AutoCompleteTextView +public class UrlInputView extends SuggestiveAutoCompleteTextView implements OnEditorActionListener, CompletionListener, OnItemClickListener { @@ -261,4 +261,7 @@ public class UrlInputView extends AutoCompleteTextView return super.onKeyDown(keyCode, evt); } + public SuggestionsAdapter getAdapter() { + return mAdapter; + } } |
