summaryrefslogtreecommitdiff
path: root/core/java/android/widget/SelectionActionModeHelper.java
diff options
context:
space:
mode:
authorJan Althaus <jalt@google.com>2017-11-14 15:40:16 +0100
committerJan Althaus <jalt@google.com>2017-11-14 15:41:59 +0100
commitb3c6ece78a171bcf2504808b4a7bd0cc2ce1d9fa (patch)
treea8bb3964b3a8a03bef6002ef98e48eb4ac21ae05 /core/java/android/widget/SelectionActionModeHelper.java
parenta9a65af6ac4414b2df2a17bb2d3d5fb9254450c3 (diff)
Widget types for unselectable and custom views
Added new constants to be used by custom text view implementions, as well as a special case for non-selectable text that will only become meaningful once we start logging linkified text. Bug: 67674199 Test: Tested that there are no regressions in the existing behaviour. Change-Id: I0167c39bdbde2783f13a8776d6e280aadf55476b
Diffstat (limited to 'core/java/android/widget/SelectionActionModeHelper.java')
-rw-r--r--core/java/android/widget/SelectionActionModeHelper.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/java/android/widget/SelectionActionModeHelper.java b/core/java/android/widget/SelectionActionModeHelper.java
index 71854ae89290..d0ad27af0a92 100644
--- a/core/java/android/widget/SelectionActionModeHelper.java
+++ b/core/java/android/widget/SelectionActionModeHelper.java
@@ -591,7 +591,9 @@ public final class SelectionActionModeHelper {
Preconditions.checkNotNull(textView);
final @SmartSelectionEventTracker.WidgetType int widgetType = textView.isTextEditable()
? SmartSelectionEventTracker.WidgetType.EDITTEXT
- : SmartSelectionEventTracker.WidgetType.TEXTVIEW;
+ : (textView.isTextSelectable()
+ ? SmartSelectionEventTracker.WidgetType.TEXTVIEW
+ : SmartSelectionEventTracker.WidgetType.UNSELECTABLE_TEXTVIEW);
mDelegate = new SmartSelectionEventTracker(textView.getContext(), widgetType);
mEditTextLogger = textView.isTextEditable();
mWordIterator = BreakIterator.getWordInstance(textView.getTextLocale());