Builder
class Builder
| kotlin.Any | |
| ↳ | android.view.textservice.SpellCheckerSession.SpellCheckerSessionParams.Builder |
Builder of SpellCheckerSessionParams.
Summary
| Public constructors | |
|---|---|
Builder()Constructs a |
|
| Public methods | |
|---|---|
| SpellCheckerSession.SpellCheckerSessionParams |
build()Returns constructed |
| SpellCheckerSession.SpellCheckerSessionParams.Builder |
Sets a bundle containing extra parameters for the spell checker. |
| SpellCheckerSession.SpellCheckerSessionParams.Builder |
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 |
Public constructors
Public methods
build
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
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
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
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.
See Also
setSupportedAttributes
fun setSupportedAttributes(supportedAttributes: Int): SpellCheckerSession.SpellCheckerSessionParams.Builder
Sets a bitmask of SuggestionsInfo attributes that the spell checker can set in SuggestionsInfo it returns.
| Return | |
|---|---|
SpellCheckerSession.SpellCheckerSessionParams.Builder |
This value cannot be null. |