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 |
build() Builds the instance. |
InlineSuggestionsRequest.Builder |
The extras state propagated from the IME to pass extra data. |
InlineSuggestionsRequest.Builder |
The |
InlineSuggestionsRequest.Builder |
Specifies the UI specification for the inline suggestion tooltip in the response. |
InlineSuggestionsRequest.Builder |
setMaxSuggestionCount(value: Int) Max number of suggestions expected from the response. |
InlineSuggestionsRequest.Builder |
setSupportedLocales(value: LocaleList) The IME provided locales for the request. |
Public constructors
Builder
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
fun addInlinePresentationSpecs(value: InlinePresentationSpec): InlineSuggestionsRequest.Builder
Parameters | |
---|---|
value |
InlinePresentationSpec: This value cannot be null . |
Return | |
---|---|
InlineSuggestionsRequest.Builder |
This value cannot be null . |
See Also
build
fun build(): InlineSuggestionsRequest
Builds the instance. This builder should not be touched after calling this!
Return | |
---|---|
InlineSuggestionsRequest |
This value cannot be null . |
setExtras
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
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
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
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
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 . |