TextClassifierEvent.TextSelectionEvent.Builder


public static final class TextClassifierEvent.TextSelectionEvent.Builder
extends Builder<TextClassifierEvent.TextSelectionEvent.Builder>

java.lang.Object
   ↳ android.view.textclassifier.TextClassifierEvent.Builder<android.view.textclassifier.TextClassifierEvent.TextSelectionEvent.Builder>
     ↳ android.view.textclassifier.TextClassifierEvent.TextSelectionEvent.Builder


Builder class for TextSelectionEvent.

Summary

Public constructors

Builder(int eventType)

Creates a builder for building TextSelectionEvents.

Public methods

TextClassifierEvent.TextSelectionEvent build()

Builds and returns a TextSelectionEvent.

TextClassifierEvent.TextSelectionEvent.Builder setRelativeSuggestedWordEndIndex(int relativeSuggestedWordEndIndex)

Sets the relative word (exclusive) index of the end of the smart selection.

TextClassifierEvent.TextSelectionEvent.Builder setRelativeSuggestedWordStartIndex(int relativeSuggestedWordStartIndex)

Sets the relative word index of the start of the smart selection.

TextClassifierEvent.TextSelectionEvent.Builder setRelativeWordEndIndex(int relativeWordEndIndex)

Sets the relative word (exclusive) index of the end of the selection.

TextClassifierEvent.TextSelectionEvent.Builder setRelativeWordStartIndex(int relativeWordStartIndex)

Sets the relative word index of the start of the selection.

Inherited methods

Public constructors

Builder

Added in API level 29
public Builder (int eventType)

Creates a builder for building TextSelectionEvents.

Parameters
eventType int: The event type. e.g. TextClassifierEvent.TYPE_SELECTION_STARTED Value is TextClassifierEvent.TYPE_SELECTION_STARTED, TextClassifierEvent.TYPE_SELECTION_MODIFIED, TextClassifierEvent.TYPE_SMART_SELECTION_SINGLE, TextClassifierEvent.TYPE_SMART_SELECTION_MULTI, TextClassifierEvent.TYPE_AUTO_SELECTION, TextClassifierEvent.TYPE_ACTIONS_SHOWN, TextClassifierEvent.TYPE_LINK_CLICKED, TextClassifierEvent.TYPE_OVERTYPE, TextClassifierEvent.TYPE_COPY_ACTION, TextClassifierEvent.TYPE_PASTE_ACTION, TextClassifierEvent.TYPE_CUT_ACTION, TextClassifierEvent.TYPE_SHARE_ACTION, TextClassifierEvent.TYPE_SMART_ACTION, TextClassifierEvent.TYPE_SELECTION_DRAG, TextClassifierEvent.TYPE_SELECTION_DESTROYED, TextClassifierEvent.TYPE_OTHER_ACTION, TextClassifierEvent.TYPE_SELECT_ALL, TextClassifierEvent.TYPE_SELECTION_RESET, TextClassifierEvent.TYPE_MANUAL_REPLY, TextClassifierEvent.TYPE_ACTIONS_GENERATED, TextClassifierEvent.TYPE_LINKS_GENERATED, or android.view.textclassifier.TextClassifierEvent.TYPE_READ_CLIPBOARD

Public methods

build

Added in API level 29
public TextClassifierEvent.TextSelectionEvent build ()

Builds and returns a TextSelectionEvent.

Returns
TextClassifierEvent.TextSelectionEvent This value cannot be null.

setRelativeSuggestedWordEndIndex

Added in API level 29
public TextClassifierEvent.TextSelectionEvent.Builder setRelativeSuggestedWordEndIndex (int relativeSuggestedWordEndIndex)

Sets the relative word (exclusive) index of the end of the smart selection.

Parameters
relativeSuggestedWordEndIndex int

Returns
TextClassifierEvent.TextSelectionEvent.Builder This value cannot be null.

setRelativeSuggestedWordStartIndex

Added in API level 29
public TextClassifierEvent.TextSelectionEvent.Builder setRelativeSuggestedWordStartIndex (int relativeSuggestedWordStartIndex)

Sets the relative word index of the start of the smart selection.

Parameters
relativeSuggestedWordStartIndex int

Returns
TextClassifierEvent.TextSelectionEvent.Builder This value cannot be null.

setRelativeWordEndIndex

Added in API level 29
public TextClassifierEvent.TextSelectionEvent.Builder setRelativeWordEndIndex (int relativeWordEndIndex)

Sets the relative word (exclusive) index of the end of the selection.

Parameters
relativeWordEndIndex int

Returns
TextClassifierEvent.TextSelectionEvent.Builder This value cannot be null.

setRelativeWordStartIndex

Added in API level 29
public TextClassifierEvent.TextSelectionEvent.Builder setRelativeWordStartIndex (int relativeWordStartIndex)

Sets the relative word index of the start of the selection.

Parameters
relativeWordStartIndex int

Returns
TextClassifierEvent.TextSelectionEvent.Builder This value cannot be null.