Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 38456260 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 25369 into eclair

* changes:
  Update the input method when the selection changes.
parents 5f78786c 241403fd
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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