Added in API level 31

Builder


class Builder
kotlin.Any
   ↳ android.view.textservice.SpellCheckerSession.SpellCheckerSessionParams.Builder

Builder of SpellCheckerSessionParams.

Summary

Public constructors

Constructs a Builder.

Public methods
SpellCheckerSession.SpellCheckerSessionParams

Returns constructed SpellCheckerSession instance.

SpellCheckerSession.SpellCheckerSessionParams.Builder
setExtras(extras: Bundle)

Sets a bundle containing extra parameters for the spell checker.

SpellCheckerSession.SpellCheckerSessionParams.Builder
setLocale(locale: Locale?)

Sets the locale in which the spell checker should operate.

SpellCheckerSession.SpellCheckerSessionParams.Builder
setShouldReferToSpellCheckerLanguageSettings(shouldReferToSpellCheckerLanguageSettings: Boolean)

Sets whether or not the user's spell checker language settings should be used to determine spell checker locale.

SpellCheckerSession.SpellCheckerSessionParams.Builder
setSupportedAttributes(supportedAttributes: Int)

Sets a bitmask of SuggestionsInfo attributes that the spell checker can set in SuggestionsInfo it returns.

Public constructors

Builder

Added in API level 31
Builder()

Constructs a Builder.

Public methods

build

Added in API level 31
fun build(): SpellCheckerSession.SpellCheckerSessionParams

Returns constructed SpellCheckerSession instance.

Before calling this method, either setLocale(java.util.Locale) should be called with a non-null locale or setShouldReferToSpellCheckerLanguageSettings(boolean) should be called with true.

setExtras

Added in API level 31
fun setExtras(extras: Bundle): SpellCheckerSession.SpellCheckerSessionParams.Builder

Sets a bundle containing extra parameters for the spell checker.

This bundle can be used to pass implementation-specific parameters to the android.service.textservice.SpellCheckerService implementation.

Parameters
extras Bundle: This value cannot be null.
Return
SpellCheckerSession.SpellCheckerSessionParams.Builder This value cannot be null.

setLocale

Added in API level 31
fun setLocale(locale: Locale?): SpellCheckerSession.SpellCheckerSessionParams.Builder

Sets the locale in which the spell checker should operate.

Parameters
locale Locale?: This value may be null.
Return
SpellCheckerSession.SpellCheckerSessionParams.Builder This value cannot be null.

setShouldReferToSpellCheckerLanguageSettings

Added in API level 31
fun setShouldReferToSpellCheckerLanguageSettings(shouldReferToSpellCheckerLanguageSettings: Boolean): SpellCheckerSession.SpellCheckerSessionParams.Builder

Sets whether or not the user's spell checker language settings should be used to determine spell checker locale.

If shouldReferToSpellCheckerLanguageSettings is true, the exact way of determining spell checker locale differs based on locale specified in setLocale(java.util.Locale). If shouldReferToSpellCheckerLanguageSettings is true and locale is null, the locale specified in Settings will be used. If shouldReferToSpellCheckerLanguageSettings is true and locale is not null, SpellCheckerSession can be created only when the locale specified in Settings is the same as locale. Exceptionally, if shouldReferToSpellCheckerLanguageSettings is true and locale is language only (e.g. "en"), the specified locale in Settings (e.g. "en_US") will be used.