am 2050de5b: Text selection is broken.

* commit '2050de5b9a5c097e30545ab822211d49031bd9dc':
  Text selection is broken.
This commit is contained in:
Gilles Debunne
2011-02-09 16:49:42 -08:00
committed by Android Git Automerger

View File

@@ -6843,11 +6843,11 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
public boolean onTouchEvent(MotionEvent event) { public boolean onTouchEvent(MotionEvent event) {
final int action = event.getActionMasked(); final int action = event.getActionMasked();
if (mInsertionPointCursorController != null) { if (hasInsertionController()) {
mInsertionPointCursorController.onTouchEvent(event); getInsertionController().onTouchEvent(event);
} }
if (mSelectionModifierCursorController != null) { if (hasSelectionController()) {
mSelectionModifierCursorController.onTouchEvent(event); getSelectionController().onTouchEvent(event);
} }
if (action == MotionEvent.ACTION_DOWN) { if (action == MotionEvent.ACTION_DOWN) {
@@ -7346,9 +7346,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
minOffset = getSelectionStart(); minOffset = getSelectionStart();
maxOffset = getSelectionEnd(); maxOffset = getSelectionEnd();
} else { } else {
// selectionModifierCursorController is not null at that point // hasSelectionController is true since we canSelectText.
SelectionModifierCursorController selectionModifierCursorController = SelectionModifierCursorController selectionModifierCursorController =
((SelectionModifierCursorController) mSelectionModifierCursorController); (SelectionModifierCursorController) getSelectionController();
minOffset = selectionModifierCursorController.getMinTouchOffset(); minOffset = selectionModifierCursorController.getMinTouchOffset();
maxOffset = selectionModifierCursorController.getMaxTouchOffset(); maxOffset = selectionModifierCursorController.getMaxTouchOffset();
} }