# 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)
public final class UiVersions
```

<br />

*** ** * ** ***

Defines the inline suggestion UI version constants.

## Summary

| ### Nested types |
|---|
| `public interface https://developer.android.com/reference/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. |
| `public interface https://developer.android.com/reference/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. |
| `public final class https://developer.android.com/reference/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 |
|---|---|
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/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 methods |
|---|---|
| `static @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/String.html>` | `https://developer.android.com/reference/androidx/autofill/inline/UiVersions#getVersions(android.os.Bundle)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/Bundle.html versionedBundle)` The `versionedBundle` is expected to be generated either by `https://developer.android.com/reference/androidx/autofill/inline/UiVersions.StylesBuilder#build()` or `https://developer.android.com/reference/androidx/autofill/inline/Renderer#getSupportedInlineUiVersionsAsBundle()`. |
| `static @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/autofill/inline/UiVersions.StylesBuilder` | `https://developer.android.com/reference/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)

```
public static final String INLINE_UI_VERSION_1 = "androidx.autofill.inline.ui.version:v1"
```

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

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

## Public methods

### getVersions

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

```
public static @NonNull List<String> getVersions(@NonNull Bundle versionedBundle)
```

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

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

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/String.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)

```
public static @NonNull UiVersions.StylesBuilder newStylesBuilder()
```

Returns a new styles builder.

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