am 38456260: Merge change 25369 into eclair
Merge commit '38456260b919497bf948c1e3fd5a7b76b5dda68a' into eclair-plus-aosp * commit '38456260b919497bf948c1e3fd5a7b76b5dda68a': Update the input method when the selection changes.
This commit is contained in:
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package android.webkit;
|
package android.webkit;
|
||||||
|
|
||||||
|
import com.android.internal.widget.EditableInputConnection;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
@@ -347,6 +349,16 @@ import java.util.ArrayList;
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onSelectionChanged(int selStart, int selEnd) {
|
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 (!mFromWebKit && mWebView != null) {
|
||||||
if (DebugFlags.WEB_TEXT_VIEW) {
|
if (DebugFlags.WEB_TEXT_VIEW) {
|
||||||
Log.v(LOGTAG, "onSelectionChanged selStart=" + selStart
|
Log.v(LOGTAG, "onSelectionChanged selStart=" + selStart
|
||||||
|
|||||||
Reference in New Issue
Block a user