Added in API level 29

Builder


class Builder : TextClassifierEvent.Builder<TextClassifierEvent.TextSelectionEvent.Builder!>
kotlin.Any
   ↳ 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(eventType: Int)

Creates a builder for building TextSelectionEvents.

Public methods
TextClassifierEvent.TextSelectionEvent

Builds and returns a TextSelectionEvent.

TextClassifierEvent.TextSelectionEvent.Builder
setRelativeSuggestedWordEndIndex(relativeSuggestedWordEndIndex: Int)

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

TextClassifierEvent.TextSelectionEvent.Builder
setRelativeSuggestedWordStartIndex(relativeSuggestedWordStartIndex: Int)

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

TextClassifierEvent.TextSelectionEvent.Builder
setRelativeWordEndIndex(relativeWordEndIndex: Int)

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

TextClassifierEvent.TextSelectionEvent.Builder
setRelativeWordStartIndex(relativeWordStartIndex: Int)

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

Inherited functions

Public constructors

Builder

Added in API level 29
Builder(eventType: Int)

Creates a builder for building TextSelectionEvents.

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

Public methods

build

Added in API level 29
fun build(): TextClassifierEvent.TextSelectionEvent

Builds and returns a TextSelectionEvent.

Return
TextClassifierEvent.TextSelectionEvent This value cannot be null.

setRelativeSuggestedWordEndIndex

Added in API level 29
fun setRelativeSuggestedWordEndIndex(relativeSuggestedWordEndIndex: Int): TextClassifierEvent.TextSelectionEvent.Builder

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

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

setRelativeSuggestedWordStartIndex

Added in API level 29
fun setRelativeSuggestedWordStartIndex(relativeSuggestedWordStartIndex: Int): TextClassifierEvent.TextSelectionEvent.Builder

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

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

setRelativeWordEndIndex

Added in API level 29
fun setRelativeWordEndIndex(relativeWordEndIndex: Int): TextClassifierEvent.TextSelectionEvent.Builder

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

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

setRelativeWordStartIndex

Added in API level 29
fun setRelativeWordStartIndex(relativeWordStartIndex: Int): TextClassifierEvent.TextSelectionEvent.Builder

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

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