Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c65b49e0 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Widget types for unselectable and custom views"

parents 1610206b b3c6ece7
Loading
Loading
Loading
Loading
+21 −5
Original line number Diff line number Diff line
@@ -60,8 +60,12 @@ public final class SmartSelectionEventTracker {
    private static final String ZERO = "0";
    private static final String TEXTVIEW = "textview";
    private static final String EDITTEXT = "edittext";
    private static final String UNSELECTABLE_TEXTVIEW = "nosel-textview";
    private static final String WEBVIEW = "webview";
    private static final String EDIT_WEBVIEW = "edit-webview";
    private static final String CUSTOM_TEXTVIEW = "customview";
    private static final String CUSTOM_EDITTEXT = "customedit";
    private static final String CUSTOM_UNSELECTABLE_TEXTVIEW = "nosel-customview";
    private static final String UNKNOWN = "unknown";

    @Retention(RetentionPolicy.SOURCE)
@@ -73,6 +77,10 @@ public final class SmartSelectionEventTracker {
        int WEBVIEW = 2;
        int EDITTEXT = 3;
        int EDIT_WEBVIEW = 4;
        int UNSELECTABLE_TEXTVIEW = 5;
        int CUSTOM_TEXTVIEW = 6;
        int CUSTOM_EDITTEXT = 7;
        int CUSTOM_UNSELECTABLE_TEXTVIEW = 8;
    }

    private final MetricsLogger mMetricsLogger = new MetricsLogger();
@@ -277,6 +285,14 @@ public final class SmartSelectionEventTracker {
                return EDITTEXT;
            case WidgetType.EDIT_WEBVIEW:
                return EDIT_WEBVIEW;
            case WidgetType.UNSELECTABLE_TEXTVIEW:
                return UNSELECTABLE_TEXTVIEW;
            case WidgetType.CUSTOM_TEXTVIEW:
                return CUSTOM_TEXTVIEW;
            case WidgetType.CUSTOM_EDITTEXT:
                return CUSTOM_EDITTEXT;
            case WidgetType.CUSTOM_UNSELECTABLE_TEXTVIEW:
                return CUSTOM_UNSELECTABLE_TEXTVIEW;
            default:
                return UNKNOWN;
        }
+3 −1
Original line number Diff line number Diff line
@@ -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());