Loading core/java/android/widget/TextView.java +8 −9 Original line number Diff line number Diff line Loading @@ -7388,14 +7388,14 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener } private boolean canSelectText() { return textCanBeSelected() && mText.length() != 0; return hasSelectionController() && mText.length() != 0; } private boolean textCanBeSelected() { // prepareCursorController() relies on this method. // If you change this condition, make sure prepareCursorController is called anywhere // the value of this condition might be changed. return (mText instanceof Spannable && mMovement != null && mMovement.canSelectArbitrarily()); return mText instanceof Spannable && mMovement != null && mMovement.canSelectArbitrarily(); } private boolean canCut() { Loading Loading @@ -7529,6 +7529,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener } private void selectCurrentWord() { if (!canSelectText()) { return; } if (hasPasswordTransformationMethod()) { // selectCurrentWord is not available on a password field and would return an // arbitrary 10-charater selection around pressed position. Select all instead. Loading @@ -7544,7 +7548,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener minOffset = getSelectionStart(); maxOffset = getSelectionEnd(); } else { // selectionModifierCursorController is guaranteed to exist at that point SelectionModifierCursorController selectionController = getSelectionController(); minOffset = selectionController.getMinTouchOffset(); maxOffset = selectionController.getMaxTouchOffset(); Loading Loading @@ -7921,14 +7924,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener selectCurrentWord(); ActionMode.Callback actionModeCallback = new SelectionActionModeCallback(); if (actionModeCallback != null) { mSelectionActionMode = startActionMode(actionModeCallback); return mSelectionActionMode != null; } return false; } /** * Same as {@link #stopSelectionActionMode()}, except that there is no cursor controller * fade out animation. Needed since the drawable and their alpha values are shared by all Loading Loading
core/java/android/widget/TextView.java +8 −9 Original line number Diff line number Diff line Loading @@ -7388,14 +7388,14 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener } private boolean canSelectText() { return textCanBeSelected() && mText.length() != 0; return hasSelectionController() && mText.length() != 0; } private boolean textCanBeSelected() { // prepareCursorController() relies on this method. // If you change this condition, make sure prepareCursorController is called anywhere // the value of this condition might be changed. return (mText instanceof Spannable && mMovement != null && mMovement.canSelectArbitrarily()); return mText instanceof Spannable && mMovement != null && mMovement.canSelectArbitrarily(); } private boolean canCut() { Loading Loading @@ -7529,6 +7529,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener } private void selectCurrentWord() { if (!canSelectText()) { return; } if (hasPasswordTransformationMethod()) { // selectCurrentWord is not available on a password field and would return an // arbitrary 10-charater selection around pressed position. Select all instead. Loading @@ -7544,7 +7548,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener minOffset = getSelectionStart(); maxOffset = getSelectionEnd(); } else { // selectionModifierCursorController is guaranteed to exist at that point SelectionModifierCursorController selectionController = getSelectionController(); minOffset = selectionController.getMinTouchOffset(); maxOffset = selectionController.getMaxTouchOffset(); Loading Loading @@ -7921,14 +7924,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener selectCurrentWord(); ActionMode.Callback actionModeCallback = new SelectionActionModeCallback(); if (actionModeCallback != null) { mSelectionActionMode = startActionMode(actionModeCallback); return mSelectionActionMode != null; } return false; } /** * Same as {@link #stopSelectionActionMode()}, except that there is no cursor controller * fade out animation. Needed since the drawable and their alpha values are shared by all Loading