diff options
| author | 2009-09-16 18:49:42 -0400 | |
|---|---|---|
| committer | 2009-09-16 18:49:42 -0400 | |
| commit | 38456260b919497bf948c1e3fd5a7b76b5dda68a (patch) | |
| tree | 1663d74aae37ff1767030d24d9d00631b06696ff | |
| parent | 5f78786cf9802b988a4de3c08555eb43f1e02e04 (diff) | |
| parent | 241403fd19edc44d089f3860db1562ed523dea07 (diff) | |
Merge change 25369 into eclair
* changes:
Update the input method when the selection changes.
| -rw-r--r-- | core/java/android/webkit/WebTextView.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/java/android/webkit/WebTextView.java b/core/java/android/webkit/WebTextView.java index a175be01f7fe..39a2470dd960 100644 --- a/core/java/android/webkit/WebTextView.java +++ b/core/java/android/webkit/WebTextView.java @@ -16,6 +16,8 @@ package android.webkit; +import com.android.internal.widget.EditableInputConnection; + import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; @@ -347,6 +349,16 @@ import java.util.ArrayList; @Override protected void onSelectionChanged(int selStart, int selEnd) { + // This code is copied from TextView.onDraw(). That code does not get + // executed, however, because the WebTextView does not draw, allowing + // webkit's drawing to show through. + InputMethodManager imm = InputMethodManager.peekInstance(); + if (imm != null && imm.isActive(this)) { + Spannable sp = (Spannable) getText(); + int candStart = EditableInputConnection.getComposingSpanStart(sp); + int candEnd = EditableInputConnection.getComposingSpanEnd(sp); + imm.updateSelection(this, selStart, selEnd, candStart, candEnd); + } if (!mFromWebKit && mWebView != null) { if (DebugFlags.WEB_TEXT_VIEW) { Log.v(LOGTAG, "onSelectionChanged selStart=" + selStart |