# UiVersions.StylesBuilder

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.StylesBuilder) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/autofill#1.1.0)

*** ** * ** ***


```
class UiVersions.StylesBuilder
```

<br />

*** ** * ** ***

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.

## Summary

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/autofill/inline/UiVersions.StylesBuilder` | `https://developer.android.com/reference/kotlin/androidx/autofill/inline/UiVersions.StylesBuilder#addStyle(androidx.autofill.inline.UiVersions.Style)(style: https://developer.android.com/reference/kotlin/androidx/autofill/inline/UiVersions.Style)` Adds a UI style. |
| `https://developer.android.com/reference/android/os/Bundle.html` | `https://developer.android.com/reference/kotlin/androidx/autofill/inline/UiVersions.StylesBuilder#build()()` Returns the styles for one or more UI versions represented as a `https://developer.android.com/reference/android/os/Bundle.html` so it can be transported through IPC. |

## Public functions

### addStyle

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

```
fun addStyle(style: UiVersions.Style): UiVersions.StylesBuilder
```

Adds a UI style.

| Parameters |
|---|---|
| `style: https://developer.android.com/reference/kotlin/androidx/autofill/inline/UiVersions.Style` | the style being added |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if the style version is not supported by the library |

### build

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

```
fun build(): Bundle
```

Returns the styles for one or more UI versions represented as a `https://developer.android.com/reference/android/os/Bundle.html` so it can be transported through IPC.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | if no style has been put in the builder |