diff options
| author | Cary Clark <cary@android.com> | 2009-06-25 10:49:32 -0400 |
|---|---|---|
| committer | Cary Clark <cary@android.com> | 2009-06-29 09:30:42 -0400 |
| commit | 243ea06d2bf67e8b54da51977687b08f49aeb093 (patch) | |
| tree | 3d10ab3977764849fed1915314277c86d7f0db64 /core/java/android/webkit/WebTextView.java | |
| parent | 215b72cbf7e8c8241dd8bbc12b8ad94825cd015e (diff) | |
Remove the web text view if the key cannot be handled
Also add some debugging to WebTextView
Requires companion change in external/webkit
Diffstat (limited to 'core/java/android/webkit/WebTextView.java')
| -rw-r--r-- | core/java/android/webkit/WebTextView.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/core/java/android/webkit/WebTextView.java b/core/java/android/webkit/WebTextView.java index 4a8fa3cb2f3b..79896f26661a 100644 --- a/core/java/android/webkit/WebTextView.java +++ b/core/java/android/webkit/WebTextView.java @@ -24,6 +24,7 @@ import android.text.Selection; import android.text.Spannable; import android.text.TextUtils; import android.text.method.MovementMethod; +import android.util.Log; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputMethodManager; import android.view.KeyCharacterMap; @@ -45,6 +46,8 @@ import java.util.ArrayList; */ /* package */ class WebTextView extends AutoCompleteTextView { + static final String LOGTAG = "webtextview"; + private WebView mWebView; private boolean mSingle; private int mWidthSpec; @@ -82,6 +85,7 @@ import java.util.ArrayList; setImeOptions(EditorInfo.IME_ACTION_NONE); // Allow webkit's drawing to show through setWillNotDraw(true); + setCursorVisible(false); } @Override @@ -268,6 +272,10 @@ import java.util.ArrayList; @Override protected void onSelectionChanged(int selStart, int selEnd) { if (mWebView != null) { + if (DebugFlags.WEB_TEXT_VIEW) { + Log.v(LOGTAG, "onSelectionChanged selStart=" + selStart + + " selEnd=" + selEnd); + } mWebView.setSelection(selStart, selEnd); } } @@ -313,6 +321,10 @@ import java.util.ArrayList; } else { // This corrects the selection which may have been affected by the // trackball or auto-correct. + if (DebugFlags.WEB_TEXT_VIEW) { + Log.v(LOGTAG, "onTextChanged start=" + start + + " start + before=" + (start + before)); + } mWebView.setSelection(start, start + before); } if (!cannotUseKeyEvents) { @@ -542,6 +554,10 @@ import java.util.ArrayList; } else if (start > length) { start = length; } + if (DebugFlags.WEB_TEXT_VIEW) { + Log.v(LOGTAG, "setText start=" + start + + " end=" + end); + } Selection.setSelection(span, start, end); } |
