TextSelection.Request.Builder


class TextSelection.Request.Builder


A builder for building TextSelection requests.

Summary

Public constructors

Builder(
    text: CharSequence,
    startIndex: @IntRange(from = 0) Int,
    endIndex: @IntRange(from = 0) Int
)

Public functions

TextSelection.Request

Builds and returns the request object.

TextSelection.Request.Builder
TextSelection.Request.Builder
setExtras(extras: Bundle?)

Sets the extended, vendor specific data.

Public constructors

Builder

Builder(
    text: CharSequence,
    startIndex: @IntRange(from = 0) Int,
    endIndex: @IntRange(from = 0) Int
)
Parameters
text: CharSequence

text providing context for the selected text (which is specified by the sub sequence starting at selectionStartIndex and ending at selectionEndIndex)

startIndex: @IntRange(from = 0) Int

start index of the selected part of text

endIndex: @IntRange(from = 0) Int

end index of the selected part of text

Public functions

build

fun build(): TextSelection.Request

Builds and returns the request object.

setDefaultLocales

fun setDefaultLocales(defaultLocales: LocaleListCompat?): TextSelection.Request.Builder
Parameters
defaultLocales: LocaleListCompat?

ordered list of locale preferences that may be used to disambiguate the provided text. If no locale preferences exist, set this to null or an empty locale list.

Returns
TextSelection.Request.Builder

this builder.

setExtras

fun setExtras(extras: Bundle?): TextSelection.Request.Builder

Sets the extended, vendor specific data.

Returns
TextSelection.Request.Builder

this builder