Added in API level 30

Builder


class Builder
kotlin.Any
   ↳ android.view.inputmethod.InlineSuggestionsRequest.Builder

A builder for InlineSuggestionsRequest

Summary

Public constructors
Builder(inlinePresentationSpecs: MutableList<InlinePresentationSpec!>)

Creates a new Builder.

Public methods
InlineSuggestionsRequest.Builder

InlineSuggestionsRequest

Builds the instance.

InlineSuggestionsRequest.Builder
setExtras(value: Bundle)

The extras state propagated from the IME to pass extra data.

InlineSuggestionsRequest.Builder

The InlinePresentationSpec for each suggestion in the response.

InlineSuggestionsRequest.Builder

Specifies the UI specification for the inline suggestion tooltip in the response.

InlineSuggestionsRequest.Builder

Max number of suggestions expected from the response.

InlineSuggestionsRequest.Builder

The IME provided locales for the request.

Public constructors

Builder

Added in API level 30
Builder(inlinePresentationSpecs: MutableList<InlinePresentationSpec!>)

Creates a new Builder.

Parameters
inlinePresentationSpecs MutableList<InlinePresentationSpec!>: The InlinePresentationSpec for each suggestion in the response. If the max suggestion count is larger than the number of specs in the list, then the last spec is used for the remainder of the suggestions. The list should not be empty. This value cannot be null.

Public methods

addInlinePresentationSpecs

Added in API level 30
fun addInlinePresentationSpecs(value: InlinePresentationSpec): InlineSuggestionsRequest.Builder
Parameters
value InlinePresentationSpec: This value cannot be null.
Return
InlineSuggestionsRequest.Builder This value cannot be null.

build

Added in API level 30
fun build(): InlineSuggestionsRequest

Builds the instance. This builder should not be touched after calling this!

Return
InlineSuggestionsRequest This value cannot be null.

setExtras

Added in API level 30
fun setExtras(value: Bundle): InlineSuggestionsRequest.Builder

The extras state propagated from the IME to pass extra data.

Note: There should be no remote objects in the bundle, all included remote objects will be removed from the bundle before transmission.

Parameters
value Bundle: This value cannot be null.
Return
InlineSuggestionsRequest.Builder This value cannot be null.

setInlinePresentationSpecs

Added in API level 30
fun setInlinePresentationSpecs(value: MutableList<InlinePresentationSpec!>): InlineSuggestionsRequest.Builder

The InlinePresentationSpec for each suggestion in the response. If the max suggestion count is larger than the number of specs in the list, then the last spec is used for the remainder of the suggestions. The list should not be empty.

Parameters
value MutableList<InlinePresentationSpec!>: This value cannot be null.
Return
InlineSuggestionsRequest.Builder This value cannot be null.

setInlineTooltipPresentationSpec

Added in API level 31
fun setInlineTooltipPresentationSpec(value: InlinePresentationSpec): InlineSuggestionsRequest.Builder

Specifies the UI specification for the inline suggestion tooltip in the response.

Parameters
value InlinePresentationSpec: This value cannot be null.
Return
InlineSuggestionsRequest.Builder This value cannot be null.

setMaxSuggestionCount

Added in API level 30
fun setMaxSuggestionCount(value: Int): InlineSuggestionsRequest.Builder

Max number of suggestions expected from the response. It must be a positive value. Defaults to SUGGESTION_COUNT_UNLIMITED if not set.

In practice, it is recommended that the max suggestion count does not exceed 5 for performance reasons.

Return
InlineSuggestionsRequest.Builder This value cannot be null.

setSupportedLocales

Added in API level 30
fun setSupportedLocales(value: LocaleList): InlineSuggestionsRequest.Builder

The IME provided locales for the request. If non-empty, the inline suggestions should return languages from the supported locales. If not provided, it'll default to be empty if target SDK is S or above, and default to system locale otherwise.

Note for Autofill Providers: It is recommended for the returned inline suggestions to have one locale to guarantee consistent UI rendering.

Parameters
value LocaleList: This value cannot be null.
Return
InlineSuggestionsRequest.Builder This value cannot be null.