diff options
| author | Leon Scroggins <scroggo@google.com> | 2010-01-11 06:58:51 -0800 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2010-01-11 06:58:51 -0800 |
| commit | f6298db02365b5f31d7ab6b4dadcbe27bee88c43 (patch) | |
| tree | 386668376304af78714856ef084c8c51aa78d9b3 /core/java/android | |
| parent | 71de7851a2d1c1ef0251bdc1ea59c5e6f58cf429 (diff) | |
| parent | ff7d33b55b799b234f66fdcf65070ef590fee6d9 (diff) | |
am ff7d33b5: am 04e0a101: Bring up IME after receiving a response from webkit.
Merge commit 'ff7d33b55b799b234f66fdcf65070ef590fee6d9'
* commit 'ff7d33b55b799b234f66fdcf65070ef590fee6d9':
Bring up IME after receiving a response from webkit.
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/webkit/WebView.java | 16 | ||||
| -rw-r--r-- | core/java/android/webkit/WebViewCore.java | 5 |
2 files changed, 10 insertions, 11 deletions
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 9d658bd66970..b10d7860c923 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -3192,14 +3192,17 @@ public class WebView extends AbsoluteLayout mWebViewCore.sendMessage(EventHub.SET_SELECTION, start, end); } - // Called by JNI when a touch event puts a textfield into focus. + /** + * Called in response to a message from webkit telling us that the soft + * keyboard should be launched. + */ private void displaySoftKeyboard(boolean isTextView) { InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE); if (isTextView) { - if (mWebTextView == null) return; - + rebuildWebTextView(); + if (!inEditingMode()) return; imm.showSoftInput(mWebTextView, 0); if (mInZoomOverview) { // if in zoom overview mode, call doDoubleTap() to bring it back @@ -5103,10 +5106,6 @@ public class WebView extends AbsoluteLayout /*package*/ void centerKeyPressOnTextField() { mWebViewCore.sendMessage(EventHub.CLICK, nativeCursorFramePointer(), nativeCursorNodePointer()); - // Need to show the soft keyboard if it's not readonly. - if (!nativeCursorIsReadOnly()) { - displaySoftKeyboard(true); - } } private void doShortPress() { @@ -5734,7 +5733,7 @@ public class WebView extends AbsoluteLayout if (msg.arg1 == 0) { hideSoftKeyboard(); } else { - displaySoftKeyboard(false); + displaySoftKeyboard(1 == msg.arg2); } break; @@ -6337,7 +6336,6 @@ public class WebView extends AbsoluteLayout /* package */ native boolean nativeCursorMatchesFocus(); private native boolean nativeCursorIntersects(Rect visibleRect); private native boolean nativeCursorIsAnchor(); - private native boolean nativeCursorIsReadOnly(); private native boolean nativeCursorIsTextInput(); private native Point nativeCursorPosition(); private native String nativeCursorText(); diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java index 724493b03269..f7989204a52d 100644 --- a/core/java/android/webkit/WebViewCore.java +++ b/core/java/android/webkit/WebViewCore.java @@ -2236,10 +2236,11 @@ final class WebViewCore { } // called by JNI - private void requestKeyboard(boolean showKeyboard) { + private void requestKeyboard(boolean showKeyboard, boolean isTextView) { if (mWebView != null) { Message.obtain(mWebView.mPrivateHandler, - WebView.REQUEST_KEYBOARD, showKeyboard ? 1 : 0, 0) + WebView.REQUEST_KEYBOARD, showKeyboard ? 1 : 0, + isTextView ? 1 : 0) .sendToTarget(); } } |
