Register now for Android Dev Summit 2019!

Builder

class Builder
kotlin.Any
   ↳ androidx.textclassifier.TextSelection.Request.Builder

A builder for building TextSelection requests.

Summary

Public constructors

<init>(@NonNull text: CharSequence, startIndex: Int, endIndex: Int)

Public methods

TextSelection.Request

Builds and returns the request object.

TextSelection.Request.Builder
setDefaultLocales(@Nullable defaultLocales: LocaleListCompat?)

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

Sets the extended, vendor specific data.

Public constructors

<init>

Builder(@NonNull text: CharSequence, startIndex: Int, endIndex: 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 CharSequence: start index of the selected part of text
endIndex CharSequence: end index of the selected part of text

Public methods

build

@NonNull fun build(): TextSelection.Request

Builds and returns the request object.

setDefaultLocales

@NonNull fun setDefaultLocales(@Nullable 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.
Return
TextSelection.Request.Builder: this builder.

setExtras

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

Sets the extended, vendor specific data.

Return
TextSelection.Request.Builder: this builder