diff options
| author | Gilles Debunne <debunne@google.com> | 2011-02-09 14:17:22 -0800 |
|---|---|---|
| committer | Gilles Debunne <debunne@google.com> | 2011-02-09 14:17:22 -0800 |
| commit | 2050de5b9a5c097e30545ab822211d49031bd9dc (patch) | |
| tree | 5bdfe34a89bbf8d2021849686174fcbacd7d34f8 /core/java/android/widget/TextView.java | |
| parent | ada1b6f297596cac4451edbc83df060a31cdda68 (diff) | |
Text selection is broken.
Bug 3439569
Lazy initialization code was not back-ported.
Change-Id: I9815f649891e2ddc602383488749144686ab1dd3
Diffstat (limited to 'core/java/android/widget/TextView.java')
| -rw-r--r-- | core/java/android/widget/TextView.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 0afd5a0222af..05e9678ca675 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -6822,11 +6822,11 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener public boolean onTouchEvent(MotionEvent event) { final int action = event.getActionMasked(); - if (mInsertionPointCursorController != null) { - mInsertionPointCursorController.onTouchEvent(event); + if (hasInsertionController()) { + getInsertionController().onTouchEvent(event); } - if (mSelectionModifierCursorController != null) { - mSelectionModifierCursorController.onTouchEvent(event); + if (hasSelectionController()) { + getSelectionController().onTouchEvent(event); } if (action == MotionEvent.ACTION_DOWN) { @@ -7324,9 +7324,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener minOffset = getSelectionStart(); maxOffset = getSelectionEnd(); } else { - // selectionModifierCursorController is not null at that point + // hasSelectionController is true since we canSelectText. SelectionModifierCursorController selectionModifierCursorController = - ((SelectionModifierCursorController) mSelectionModifierCursorController); + (SelectionModifierCursorController) getSelectionController(); minOffset = selectionModifierCursorController.getMinTouchOffset(); maxOffset = selectionModifierCursorController.getMaxTouchOffset(); } |
