Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# Builder

*** ** * ** ***

```
class Builder
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.view.inputmethod.TextAttribute.Builder](https://developer.android.com/reference/kotlin/android/view/inputmethod/TextAttribute.Builder#) |

Builder for creating a `https://developer.android.com/reference/kotlin/android/view/inputmethod/TextAttribute`.

## Summary

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/view/inputmethod/TextAttribute.Builder#Builder()()` <br /> |

| Public methods ||
|---|---|
| [TextAttribute](https://developer.android.com/reference/kotlin/android/view/inputmethod/TextAttribute) | `https://developer.android.com/reference/kotlin/android/view/inputmethod/TextAttribute.Builder#build()()` <br /> |
| [TextAttribute.Builder](https://developer.android.com/reference/kotlin/android/view/inputmethod/TextAttribute.Builder#) | `https://developer.android.com/reference/kotlin/android/view/inputmethod/TextAttribute.Builder#setExtras(android.os.PersistableBundle)(extras: https://developer.android.com/reference/kotlin/android/os/PersistableBundle.html#)` Sets extras data. |
| [TextAttribute.Builder](https://developer.android.com/reference/kotlin/android/view/inputmethod/TextAttribute.Builder#) | `https://developer.android.com/reference/kotlin/android/view/inputmethod/TextAttribute.Builder#setTextConversionSuggestions(kotlin.collections.MutableList)(textConversionSuggestions: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!>)` Sets text conversion suggestions. |
| [TextAttribute.Builder](https://developer.android.com/reference/kotlin/android/view/inputmethod/TextAttribute.Builder#) | `https://developer.android.com/reference/kotlin/android/view/inputmethod/TextAttribute.Builder#setTextSuggestionSelected(kotlin.Boolean)(textSuggestionSelected: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` Sets whether a text conversion suggestion is currently being selected. |

## Public constructors

### Builder

```
Builder()
```

## Public methods

### build

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun build(): TextAttribute
```

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/view/inputmethod/TextAttribute` | a new `https://developer.android.com/reference/kotlin/android/view/inputmethod/TextAttribute`. This value cannot be `null`. |

### setExtras

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun setExtras(extras: PersistableBundle): TextAttribute.Builder
```

Sets extras data.

Any extra data to supply to the applications. This field is for extended communication with IME if there is data not defined in framework.

| Parameters ||
|---|---|
| `extras` | [PersistableBundle](https://developer.android.com/reference/kotlin/android/os/PersistableBundle.html#): This value cannot be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/view/inputmethod/TextAttribute.Builder#` | This builder. This value cannot be `null`. |

### setTextConversionSuggestions

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun setTextConversionSuggestions(textConversionSuggestions: MutableList<String!>): TextAttribute.Builder
```

Sets text conversion suggestions.

Text conversion suggestion is for some transliteration languages which has pronunciation characters and target characters. When the user is typing the pronunciation characters, the input method can insert possible target characters into this list so that the editor authors can provide suggestion before the user enters the complete pronunciation characters.

| Parameters ||
|---|---|
| `textConversionSuggestions` | [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\>: The list of text conversion suggestions. This value cannot be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/view/inputmethod/TextAttribute.Builder#` | This builder. This value cannot be `null`. |

### setTextSuggestionSelected

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun setTextSuggestionSelected(textSuggestionSelected: Boolean): TextAttribute.Builder
```

Sets whether a text conversion suggestion is currently being selected.

In some transliteration languages, this describes the state which the user is currently selecting a text conversion suggestion. In other words, if set to True the user is in an ephemeral state of selecting which text will replace the current composition text.

| Parameters ||
|---|---|
| `textSuggestionSelected` | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html): Whether if the current text is undergoing text suggestion selection |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/view/inputmethod/TextAttribute.Builder#` | This builder. This value cannot be `null`. |