am 04e0a101: Bring up IME after receiving a response from webkit.
Merge commit '04e0a1018f69b38827e63a7f19a4d1e341f9725a' into eclair-mr2-plus-aosp * commit '04e0a1018f69b38827e63a7f19a4d1e341f9725a': Bring up IME after receiving a response from webkit.
This commit is contained in:
@@ -3193,14 +3193,17 @@ public class WebView extends AbsoluteLayout
|
|||||||
mWebViewCore.sendMessage(EventHub.SET_SELECTION, start, end);
|
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) {
|
private void displaySoftKeyboard(boolean isTextView) {
|
||||||
InputMethodManager imm = (InputMethodManager)
|
InputMethodManager imm = (InputMethodManager)
|
||||||
getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
|
|
||||||
if (isTextView) {
|
if (isTextView) {
|
||||||
if (mWebTextView == null) return;
|
rebuildWebTextView();
|
||||||
|
if (!inEditingMode()) return;
|
||||||
imm.showSoftInput(mWebTextView, 0);
|
imm.showSoftInput(mWebTextView, 0);
|
||||||
if (mInZoomOverview) {
|
if (mInZoomOverview) {
|
||||||
// if in zoom overview mode, call doDoubleTap() to bring it back
|
// if in zoom overview mode, call doDoubleTap() to bring it back
|
||||||
@@ -5099,10 +5102,6 @@ public class WebView extends AbsoluteLayout
|
|||||||
/*package*/ void centerKeyPressOnTextField() {
|
/*package*/ void centerKeyPressOnTextField() {
|
||||||
mWebViewCore.sendMessage(EventHub.CLICK, nativeCursorFramePointer(),
|
mWebViewCore.sendMessage(EventHub.CLICK, nativeCursorFramePointer(),
|
||||||
nativeCursorNodePointer());
|
nativeCursorNodePointer());
|
||||||
// Need to show the soft keyboard if it's not readonly.
|
|
||||||
if (!nativeCursorIsReadOnly()) {
|
|
||||||
displaySoftKeyboard(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doShortPress() {
|
private void doShortPress() {
|
||||||
@@ -5743,7 +5742,7 @@ public class WebView extends AbsoluteLayout
|
|||||||
if (msg.arg1 == 0) {
|
if (msg.arg1 == 0) {
|
||||||
hideSoftKeyboard();
|
hideSoftKeyboard();
|
||||||
} else {
|
} else {
|
||||||
displaySoftKeyboard(false);
|
displaySoftKeyboard(1 == msg.arg2);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -6346,7 +6345,6 @@ public class WebView extends AbsoluteLayout
|
|||||||
/* package */ native boolean nativeCursorMatchesFocus();
|
/* package */ native boolean nativeCursorMatchesFocus();
|
||||||
private native boolean nativeCursorIntersects(Rect visibleRect);
|
private native boolean nativeCursorIntersects(Rect visibleRect);
|
||||||
private native boolean nativeCursorIsAnchor();
|
private native boolean nativeCursorIsAnchor();
|
||||||
private native boolean nativeCursorIsReadOnly();
|
|
||||||
private native boolean nativeCursorIsTextInput();
|
private native boolean nativeCursorIsTextInput();
|
||||||
private native Point nativeCursorPosition();
|
private native Point nativeCursorPosition();
|
||||||
private native String nativeCursorText();
|
private native String nativeCursorText();
|
||||||
|
|||||||
@@ -2245,10 +2245,11 @@ final class WebViewCore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// called by JNI
|
// called by JNI
|
||||||
private void requestKeyboard(boolean showKeyboard) {
|
private void requestKeyboard(boolean showKeyboard, boolean isTextView) {
|
||||||
if (mWebView != null) {
|
if (mWebView != null) {
|
||||||
Message.obtain(mWebView.mPrivateHandler,
|
Message.obtain(mWebView.mPrivateHandler,
|
||||||
WebView.REQUEST_KEYBOARD, showKeyboard ? 1 : 0, 0)
|
WebView.REQUEST_KEYBOARD, showKeyboard ? 1 : 0,
|
||||||
|
isTextView ? 1 : 0)
|
||||||
.sendToTarget();
|
.sendToTarget();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user