Merge "Update insertion handler for WebTextView." into gingerbread

This commit is contained in:
Leon Scroggins
2010-11-01 14:49:47 -07:00
committed by Android (Google) Code Review
3 changed files with 16 additions and 0 deletions

View File

@@ -334,6 +334,10 @@ import java.util.ArrayList;
}
}
public void onDrawSubstitute() {
updateCursorControllerPositions();
}
@Override
public void onEditorAction(int actionCode) {
switch (actionCode) {

View File

@@ -3531,6 +3531,9 @@ public class WebView extends AbsoluteLayout
if (AUTO_REDRAW_HACK && mAutoRedraw) {
invalidate();
}
if (inEditingMode()) {
mWebTextView.onDrawSubstitute();
}
mWebViewCore.signalRepaintDone();
}

View File

@@ -4162,6 +4162,15 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
canvas.restore();
updateCursorControllerPositions();
}
/**
* Update the positions of the CursorControllers. Needed by WebTextView,
* which does not draw.
* @hide
*/
protected void updateCursorControllerPositions() {
if (mInsertionPointCursorController != null &&
mInsertionPointCursorController.isShowing()) {
mInsertionPointCursorController.updatePosition();