summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/UrlInputView.java
diff options
context:
space:
mode:
authorMichael Kolb <kolby@google.com>2010-12-14 10:36:11 -0800
committerMichael Kolb <kolby@google.com>2010-12-15 09:12:17 -0800
commitcfa3af5c59abb38c895416a80ef16da0ec1b5287 (patch)
tree18afb4abaf1539d46c3eec57100cca1faa5877fb /src/com/android/browser/UrlInputView.java
parent478b2442684004d6dfe192c0ae3dd04845b9f1b7 (diff)
downloadpackages_apps_browser-cfa3af5c59abb38c895416a80ef16da0ec1b5287.zip
packages_apps_browser-cfa3af5c59abb38c895416a80ef16da0ec1b5287.tar.gz
packages_apps_browser-cfa3af5c59abb38c895416a80ef16da0ec1b5287.tar.bz2
Enable voice search
http://b/issue?id=3039695 send voice search intent implement voice search title bar also fixes another Urlbar focus handling bug Change-Id: Icdcbec9ffff586d445545cc7fe86ca045022f381
Diffstat (limited to 'src/com/android/browser/UrlInputView.java')
-rw-r--r--src/com/android/browser/UrlInputView.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/com/android/browser/UrlInputView.java b/src/com/android/browser/UrlInputView.java
index bd47f6a..505662d 100644
--- a/src/com/android/browser/UrlInputView.java
+++ b/src/com/android/browser/UrlInputView.java
@@ -30,6 +30,8 @@ import android.widget.AutoCompleteTextView;
import android.widget.TextView;
import android.widget.TextView.OnEditorActionListener;
+import java.util.List;
+
/**
* url/search input view
* handling suggestions
@@ -48,6 +50,7 @@ public class UrlInputView extends AutoCompleteTextView
private OnFocusChangeListener mWrappedFocusListener;
private View mContainer;
private boolean mLandscape;
+ private boolean mInVoiceMode;
public UrlInputView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
@@ -85,6 +88,11 @@ public class UrlInputView extends AutoCompleteTextView
mContainer = container;
}
+ void setVoiceResults(List<String> voiceResults) {
+ mAdapter.setVoiceResults(voiceResults);
+ mInVoiceMode = (voiceResults != null);
+ }
+
@Override
protected void onConfigurationChanged(Configuration config) {
super.onConfigurationChanged(config);
@@ -134,6 +142,10 @@ public class UrlInputView extends AutoCompleteTextView
public void onFocusChange(View v, boolean hasFocus) {
if (hasFocus) {
forceIme();
+ if (mInVoiceMode) {
+ performFiltering(getText().toString(), 0);
+ showDropDown();
+ }
} else {
finishInput(null, null, null);
}