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
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.TextView;
import android.widget.TextView.OnEditorActionListener;
+import java.util.List;
+
/**
* url/search input view
* handling suggestions
@@ -48,6 +50,7 @@
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 @@
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 void onFocusChange(View v, boolean hasFocus) {
if (hasFocus) {
forceIme();
+ if (mInVoiceMode) {
+ performFiltering(getText().toString(), 0);
+ showDropDown();
+ }
} else {
finishInput(null, null, null);
}