# 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)

*** ** * ** ***


```
public final 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 |
|---|
| `public final class https://developer.android.com/reference/androidx/core/view/inputmethod/TextAttributeCompat.Builder` Builder for creating a `https://developer.android.com/reference/androidx/core/view/inputmethod/TextAttributeCompat`. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/os/PersistableBundle.html` | `https://developer.android.com/reference/androidx/core/view/inputmethod/TextAttributeCompat#getExtras()()` Get the extras data. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/String.html>` | `https://developer.android.com/reference/androidx/core/view/inputmethod/TextAttributeCompat#getTextConversionSuggestions()()` Get the list of text conversion suggestions. |
| `boolean` | `https://developer.android.com/reference/androidx/core/view/inputmethod/TextAttributeCompat#isTextSuggestionSelected()()` Get whether the text is undergoing a text candidate selection. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html` | `https://developer.android.com/reference/androidx/core/view/inputmethod/TextAttributeCompat#unwrap()()` Gets the underlying framework `https://developer.android.com/reference/android/view/inputmethod/TextAttribute.html` object. |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/inputmethod/TextAttributeCompat` | `https://developer.android.com/reference/androidx/core/view/inputmethod/TextAttributeCompat#wrap(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html textAttribute)` Creates an instance from a framework `https://developer.android.com/reference/android/view/inputmethod/TextAttribute.html` object. |

## Public methods

### getExtras

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

```
public @NonNull PersistableBundle getExtras()
```

Get the extras data.

### getTextConversionSuggestions

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

```
public @NonNull List<String> getTextConversionSuggestions()
```

Get the list of text conversion suggestions.

### isTextSuggestionSelected

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

```
public boolean isTextSuggestionSelected()
```

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)

```
public @Nullable Object unwrap()
```

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

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.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)

```
public static @Nullable TextAttributeCompat wrap(@Nullable Object textAttribute)
```

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

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html textAttribute` | an `https://developer.android.com/reference/android/view/inputmethod/TextAttribute.html` object, or `null`. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/inputmethod/TextAttributeCompat` | an equivalent `https://developer.android.com/reference/androidx/core/view/inputmethod/TextAttributeCompat` object, or `null` if not supported. |