Skip to content

Commit 2050de5

Browse files
author
Gilles Debunne
committed
Text selection is broken.
Bug 3439569 Lazy initialization code was not back-ported. Change-Id: I9815f649891e2ddc602383488749144686ab1dd3
1 parent ada1b6f commit 2050de5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

core/java/android/widget/TextView.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6822,11 +6822,11 @@ protected void onReceiveResult(int resultCode, Bundle resultData) {
68226822
public boolean onTouchEvent(MotionEvent event) {
68236823
final int action = event.getActionMasked();
68246824

6825-
if (mInsertionPointCursorController != null) {
6826-
mInsertionPointCursorController.onTouchEvent(event);
6825+
if (hasInsertionController()) {
6826+
getInsertionController().onTouchEvent(event);
68276827
}
6828-
if (mSelectionModifierCursorController != null) {
6829-
mSelectionModifierCursorController.onTouchEvent(event);
6828+
if (hasSelectionController()) {
6829+
getSelectionController().onTouchEvent(event);
68306830
}
68316831

68326832
if (action == MotionEvent.ACTION_DOWN) {
@@ -7324,9 +7324,9 @@ private void selectCurrentWord() {
73247324
minOffset = getSelectionStart();
73257325
maxOffset = getSelectionEnd();
73267326
} else {
7327-
// selectionModifierCursorController is not null at that point
7327+
// hasSelectionController is true since we canSelectText.
73287328
SelectionModifierCursorController selectionModifierCursorController =
7329-
((SelectionModifierCursorController) mSelectionModifierCursorController);
7329+
(SelectionModifierCursorController) getSelectionController();
73307330
minOffset = selectionModifierCursorController.getMinTouchOffset();
73317331
maxOffset = selectionModifierCursorController.getMaxTouchOffset();
73327332
}

0 commit comments

Comments
 (0)