diff options
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/webkit/WebTextView.java | 41 | ||||
-rw-r--r-- | core/java/android/webkit/WebView.java | 2 |
2 files changed, 17 insertions, 26 deletions
diff --git a/core/java/android/webkit/WebTextView.java b/core/java/android/webkit/WebTextView.java index 6d0be43..68be08d 100644 --- a/core/java/android/webkit/WebTextView.java +++ b/core/java/android/webkit/WebTextView.java @@ -145,6 +145,12 @@ import java.util.ArrayList; break; } + if (KeyEvent.KEYCODE_TAB == keyCode) { + if (down) { + onEditorAction(EditorInfo.IME_ACTION_NEXT); + } + return true; + } Spannable text = (Spannable) getText(); int oldLength = text.length(); // Normally the delete key's dom events are sent via onTextChanged. @@ -819,6 +825,7 @@ import java.util.ArrayList; break; case 2: // PASSWORD inPassword = true; + imeOptions |= EditorInfo.IME_ACTION_GO; break; case 3: // SEARCH imeOptions |= EditorInfo.IME_ACTION_SEARCH; @@ -826,20 +833,22 @@ import java.util.ArrayList; case 4: // EMAIL // TYPE_TEXT_VARIATION_WEB_EDIT_TEXT prevents EMAIL_ADDRESS // from working, so exclude it for now. - inputType = EditorInfo.TYPE_CLASS_TEXT - | EditorInfo.TYPE_TEXT_VARIATION_EMAIL_ADDRESS; + imeOptions |= EditorInfo.IME_ACTION_GO; break; case 5: // NUMBER - inputType = EditorInfo.TYPE_CLASS_NUMBER; + inputType |= EditorInfo.TYPE_CLASS_NUMBER; + // Number and telephone do not have both a Tab key and an + // action, so set the action to NEXT + imeOptions |= EditorInfo.IME_ACTION_NEXT; break; case 6: // TELEPHONE - inputType = EditorInfo.TYPE_CLASS_PHONE; + inputType |= EditorInfo.TYPE_CLASS_PHONE; + imeOptions |= EditorInfo.IME_ACTION_NEXT; break; case 7: // URL - // TYPE_TEXT_VARIATION_WEB_EDIT_TEXT prevents URI - // from working, so exclude it for now. - inputType = EditorInfo.TYPE_CLASS_TEXT - | EditorInfo.TYPE_TEXT_VARIATION_URI; + // TYPE_TEXT_VARIATION_URI prevents Tab key from showing, so + // exclude it for now. + imeOptions |= EditorInfo.IME_ACTION_GO; break; default: break; @@ -855,22 +864,6 @@ import java.util.ArrayList; mWebView.requestFormData(name, mNodePointer); } } - if (type != 3 /* SEARCH */) { - int action = mWebView.nativeTextFieldAction(); - switch (action) { - // Keep in sync with CachedRoot::ImeAction - case 0: // NEXT - imeOptions |= EditorInfo.IME_ACTION_NEXT; - break; - case 1: // GO - imeOptions |= EditorInfo.IME_ACTION_GO; - break; - case -1: // FAILURE - case 2: // DONE - imeOptions |= EditorInfo.IME_ACTION_DONE; - break; - } - } } mSingle = single; setMaxLength(maxLength); diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 554c8c0..52c0e01 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -6784,8 +6784,6 @@ public class WebView extends AbsoluteLayout private native void nativeSetFindIsUp(); private native void nativeSetFollowedLink(boolean followed); private native void nativeSetHeightCanMeasure(boolean measure); - // Returns a value corresponding to CachedFrame::ImeAction - /* package */ native int nativeTextFieldAction(); private native int nativeTextGeneration(); // Never call this version except by updateCachedTextfield(String) - // we always want to pass in our generation number. |