# TextAttributeCompat

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/view/inputmethod/TextAttributeCompat.java+class:androidx.core.view.inputmethod.TextAttributeCompat) Added in [1.19.1](https://developer.android.com/jetpack/androidx/releases/core#1.19.1)

*** ** * ** ***


```
class TextAttributeCompat
```

<br />

*** ** * ** ***

Helper for accessing features in `https://developer.android.com/reference/android/view/inputmethod/TextAttribute.html` in a backwards compatible fashion.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/core/view/inputmethod/TextAttributeCompat.Builder` Builder for creating a `https://developer.android.com/reference/kotlin/androidx/core/view/inputmethod/TextAttributeCompat`. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/android/os/PersistableBundle.html` | `https://developer.android.com/reference/kotlin/androidx/core/view/inputmethod/TextAttributeCompat#getExtras()()` Get the extras data. |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>` | `https://developer.android.com/reference/kotlin/androidx/core/view/inputmethod/TextAttributeCompat#getTextConversionSuggestions()()` Get the list of text conversion suggestions. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/view/inputmethod/TextAttributeCompat#isTextSuggestionSelected()()` Get whether the text is undergoing a text candidate selection. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` | `https://developer.android.com/reference/kotlin/androidx/core/view/inputmethod/TextAttributeCompat#unwrap()()` Gets the underlying framework `https://developer.android.com/reference/android/view/inputmethod/TextAttribute.html` object. |
| `java-static https://developer.android.com/reference/kotlin/androidx/core/view/inputmethod/TextAttributeCompat?` | `https://developer.android.com/reference/kotlin/androidx/core/view/inputmethod/TextAttributeCompat#wrap(java.lang.Object)(textAttribute: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` Creates an instance from a framework `https://developer.android.com/reference/android/view/inputmethod/TextAttribute.html` object. |

## Public functions

### getExtras

Added in [1.19.1](https://developer.android.com/jetpack/androidx/releases/core#1.19.1)

```
fun getExtras(): PersistableBundle
```

Get the extras data.

### getTextConversionSuggestions

Added in [1.19.1](https://developer.android.com/jetpack/androidx/releases/core#1.19.1)

```
fun getTextConversionSuggestions(): (Mutable)List<String!>
```

Get the list of text conversion suggestions.

### isTextSuggestionSelected

Added in [1.19.1](https://developer.android.com/jetpack/androidx/releases/core#1.19.1)

```
fun isTextSuggestionSelected(): Boolean
```

Get whether the text is undergoing a text candidate selection.

### unwrap

Added in [1.19.1](https://developer.android.com/jetpack/androidx/releases/core#1.19.1)

```
fun unwrap(): Any?
```

Gets the underlying framework `https://developer.android.com/reference/android/view/inputmethod/TextAttribute.html` object.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` | an equivalent `https://developer.android.com/reference/android/view/inputmethod/TextAttribute.html` object, or `null` if not supported. |

### wrap

Added in [1.19.1](https://developer.android.com/jetpack/androidx/releases/core#1.19.1)

```
java-static fun wrap(textAttribute: Any?): TextAttributeCompat?
```

Creates an instance from a framework `https://developer.android.com/reference/android/view/inputmethod/TextAttribute.html` object.

| Parameters |
|---|---|
| `textAttribute: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` | an `https://developer.android.com/reference/android/view/inputmethod/TextAttribute.html` object, or `null`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/core/view/inputmethod/TextAttributeCompat?` | an equivalent `https://developer.android.com/reference/kotlin/androidx/core/view/inputmethod/TextAttributeCompat` object, or `null` if not supported. |