# UiVersions

Artifact: [androidx.autofill:autofill](https://developer.android.com/jetpack/androidx/releases/autofill) [View Source](https://cs.android.com/search?q=file:androidx/autofill/inline/UiVersions.java+class:androidx.autofill.inline.UiVersions) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/autofill#1.1.0)

*** ** * ** ***


```
@RequiresApi(api = Build.VERSION_CODES.R)
class UiVersions
```

<br />

*** ** * ** ***

Defines the inline suggestion UI version constants.

## Summary

| ### Nested types |
|---|
| `interface https://developer.android.com/reference/kotlin/androidx/autofill/inline/UiVersions.Content` Represents the UI content that can be converted into a `https://developer.android.com/reference/android/app/slice/Slice.html` to be read to render a UI in a remote process. |
| `interface https://developer.android.com/reference/kotlin/androidx/autofill/inline/UiVersions.Style` Represents a UI style specification that contains the version information and can be converted into a Bundle to be read to render a UI in a remote process. |
| `class https://developer.android.com/reference/kotlin/androidx/autofill/inline/UiVersions.StylesBuilder` A builder responsible for providing a `https://developer.android.com/reference/android/os/Bundle.html` with encoded UI style specifications for one or more versions of UI templates. |

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/autofill/inline/UiVersions#INLINE_UI_VERSION_1() = "androidx.autofill.inline.ui.version:v1"` The ID for the version 1 implementation of the inline UI library. |

| ### Public functions |
|---|---|
| `java-static (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/autofill/inline/UiVersions#getVersions(android.os.Bundle)(versionedBundle: https://developer.android.com/reference/android/os/Bundle.html)` The `versionedBundle` is expected to be generated either by `https://developer.android.com/reference/kotlin/androidx/autofill/inline/UiVersions.StylesBuilder#build()` or `https://developer.android.com/reference/kotlin/androidx/autofill/inline/Renderer#getSupportedInlineUiVersionsAsBundle()`. |
| `java-static https://developer.android.com/reference/kotlin/androidx/autofill/inline/UiVersions.StylesBuilder` | `https://developer.android.com/reference/kotlin/androidx/autofill/inline/UiVersions#newStylesBuilder()()` Returns a new styles builder. |

## Constants

### INLINE_UI_VERSION_1

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

```
const val INLINE_UI_VERSION_1 = "androidx.autofill.inline.ui.version:v1": String!
```

The ID for the version 1 implementation of the inline UI library.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/autofill/inline/v1/InlineSuggestionUi` |   |

## Public functions

### getVersions

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

```
java-static fun getVersions(versionedBundle: Bundle): (Mutable)List<String!>
```

The `versionedBundle` is expected to be generated either by `https://developer.android.com/reference/kotlin/androidx/autofill/inline/UiVersions.StylesBuilder#build()` or `https://developer.android.com/reference/kotlin/androidx/autofill/inline/Renderer#getSupportedInlineUiVersionsAsBundle()`.

| Parameters |
|---|---|
| `versionedBundle: https://developer.android.com/reference/android/os/Bundle.html` | the bundle that encodes the versions information. |

| Returns |
|---|---|
| `(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!>` | the list of versions that are both specified in the `versionedBundle` and supported by the current library. |

### newStylesBuilder

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

```
java-static fun newStylesBuilder(): UiVersions.StylesBuilder
```

Returns a new styles builder.

See `https://developer.android.com/reference/kotlin/androidx/autofill/inline/v1/InlineSuggestionUi` for example usage.