summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/NavigationBarBase.java
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2011-11-18 08:42:15 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-11-18 08:42:15 -0800
commit3e5e5fada69d74bb50b14ef3588e7beadaedfd69 (patch)
tree1487efca1a05cd57f01ff295be298978a035d01d /src/com/android/browser/NavigationBarBase.java
parenta9a5967ea18d4b442ae5433cd3759b3921e480ad (diff)
parentf3174a588cdf63ef59055998c23aad4b36b7856e (diff)
downloadpackages_apps_Browser-3e5e5fada69d74bb50b14ef3588e7beadaedfd69.zip
packages_apps_Browser-3e5e5fada69d74bb50b14ef3588e7beadaedfd69.tar.gz
packages_apps_Browser-3e5e5fada69d74bb50b14ef3588e7beadaedfd69.tar.bz2
Merge "Remove the psychic labs feature." into ics-mr1
Diffstat (limited to 'src/com/android/browser/NavigationBarBase.java')
-rw-r--r--src/com/android/browser/NavigationBarBase.java37
1 files changed, 18 insertions, 19 deletions
diff --git a/src/com/android/browser/NavigationBarBase.java b/src/com/android/browser/NavigationBarBase.java
index 6a1b340..128304c 100644
--- a/src/com/android/browser/NavigationBarBase.java
+++ b/src/com/android/browser/NavigationBarBase.java
@@ -22,6 +22,8 @@ import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.speech.RecognizerResultsIntent;
+import android.text.Editable;
+import android.text.TextWatcher;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.view.View;
@@ -31,15 +33,13 @@ import android.webkit.WebView;
import android.widget.ImageView;
import android.widget.LinearLayout;
-import com.android.browser.UI.DropdownChangeListener;
import com.android.browser.UrlInputView.UrlInputListener;
-import com.android.browser.autocomplete.SuggestedTextController.TextChangeWatcher;
import java.util.List;
public class NavigationBarBase extends LinearLayout implements
OnClickListener, UrlInputListener, OnFocusChangeListener,
- TextChangeWatcher {
+ TextWatcher {
protected BaseUi mBaseUi;
protected TitleBar mTitleBar;
@@ -71,7 +71,7 @@ public class NavigationBarBase extends LinearLayout implements
mUrlInput.setUrlInputListener(this);
mUrlInput.setOnFocusChangeListener(this);
mUrlInput.setSelectAllOnFocus(true);
- mUrlInput.addQueryTextWatcher(this);
+ mUrlInput.addTextChangedListener(this);
}
public void setTitleBar(TitleBar titleBar) {
@@ -145,16 +145,6 @@ public class NavigationBarBase extends LinearLayout implements
}
}
- // UrlInput text watcher
-
- @Override
- public void onTextChanged(String newText) {
- if (mUrlInput.hasFocus()) {
- // clear voice mode when user types
- setInVoiceMode(false, null);
- }
- }
-
// voicesearch
public void setInVoiceMode(boolean voicemode, List<String> voiceResults) {
@@ -167,7 +157,7 @@ public class NavigationBarBase extends LinearLayout implements
}
void clearCompletions() {
- mUrlInput.setSuggestedText(null);
+ mUrlInput.dismissDropDown();
}
// UrlInputListener implementation
@@ -254,10 +244,6 @@ public class NavigationBarBase extends LinearLayout implements
return super.dispatchKeyEventPreIme(evt);
}
- void registerDropdownChangeListener(DropdownChangeListener d) {
- mUrlInput.registerDropdownChangeListener(d);
- }
-
/**
* called from the Ui when the user wants to edit
* @param clearInput clear the input field
@@ -291,4 +277,17 @@ public class NavigationBarBase extends LinearLayout implements
public void onTabDataChanged(Tab tab) {
}
+ @Override
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) { }
+
+ @Override
+ public void onTextChanged(CharSequence s, int start, int before, int count) {
+ if (mUrlInput.hasFocus()) {
+ // clear voice mode when user types
+ setInVoiceMode(false, null);
+ }
+ }
+
+ @Override
+ public void afterTextChanged(Editable s) { }
}