# UserStyle

Artifact: [androidx.wear.watchface:watchface-style](https://developer.android.com/jetpack/androidx/releases/wear-watchface) [View Source](https://cs.android.com/search?q=file:androidx/wear/watchface/style/CurrentUserStyleRepository.kt+class:androidx.wear.watchface.style.UserStyle) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

*** ** * ** ***


```
class UserStyle : Map<UserStyleSetting, UserStyleSetting.Option>
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

An immutable representation of user style choices that maps each `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSetting` to `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSetting.Option`.

This is intended for use by the WatchFace and entries are the same as the ones specified in the `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSchema`. This means you can't serialize a UserStyle directly, instead you need to use a `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleData` (see `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#toUserStyleData()`).

To modify the user style, you should call `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#toMutableUserStyle()` and construct a new `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle` instance with `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/MutableUserStyle#toUserStyle()`.

use Watch Face Format instead

## Summary

| ### Public constructors |
|---|
| `[UserStyle](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#UserStyle(kotlin.collections.Map))( selectedOptions: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSetting, https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSetting.Option> )` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `[UserStyle](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#UserStyle(androidx.wear.watchface.style.UserStyle))(userStyle: https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle)` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `[UserStyle](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#UserStyle(androidx.wear.watchface.style.UserStyleData,androidx.wear.watchface.style.UserStyleSchema))(userStyle: https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleData, styleSchema: https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSchema)` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |

| ### Public functions |
|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `[containsKey](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#containsKey(androidx.wear.watchface.style.UserStyleSetting))(key: https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSetting)` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `[containsValue](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#containsValue(androidx.wear.watchface.style.UserStyleSetting.Option))(value: https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSetting.Option)` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `[equals](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#equals(kotlin.Any))(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `open operator https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSetting.Option?` | `[get](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#get(androidx.wear.watchface.style.UserStyleSetting))(key: https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSetting)` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `operator https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSetting.Option?` | `[get](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#get(androidx.wear.watchface.style.UserStyleSetting.Id))(settingId: https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSetting.Id)` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `[hashCode](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#hashCode())()` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `[isEmpty](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#isEmpty())()` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/MutableUserStyle` | `[toMutableUserStyle](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#toMutableUserStyle())()` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `[toString](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#toString())()` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleData` | `[toUserStyleData](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#toUserStyleData())()` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |

| ### Public properties |
|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/-entry/index.html<https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSetting, https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSetting.Option>>` | `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#entries()` **This property is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSetting>` | `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#keys()` **This property is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#size()` **This property is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-collection/index.html<https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSetting.Option>` | `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#values()` **This property is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |

### Inherited functions

From [kotlin.collections.Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html) `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[forEach](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/for-each.html)(
@https://developer.android.com/reference/kotlin/androidx/annotation/RecentlyNonNull action: https://developer.android.com/reference/java/util/function/BiConsumer.html<https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSetting, https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSetting.Option>
)`

**This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead.
`open https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSetting.Option` `@https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-since-kotlin/index.html(version = "1.1")
@kotlin.internal.PlatformDependent
[getOrDefault](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/get-or-default.html)(
key: https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSetting,
defaultValue: https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSetting.Option
)`

**This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead.

## Public constructors

### UserStyle

```
[UserStyle](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#UserStyle(kotlin.collections.Map))(
    selectedOptions: Map<UserStyleSetting, UserStyleSetting.Option>
)
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Constructs a `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle` with the given selected options for each setting.

A copy of the `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#(kotlin.collections.Map)` map will be created, so that changed to the map will not be reflected by this object.

| Parameters |
|---|---|
| `selectedOptions: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSetting, https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSetting.Option>` | The `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSetting.Option` selected for each `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSetting` |

### UserStyle

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
[UserStyle](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#UserStyle(androidx.wear.watchface.style.UserStyle))(userStyle: UserStyle)
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Constructs a copy of the `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle`. It is backed by the same map.

### UserStyle

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
[UserStyle](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#UserStyle(androidx.wear.watchface.style.UserStyleData,androidx.wear.watchface.style.UserStyleSchema))(userStyle: UserStyleData, styleSchema: UserStyleSchema)
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Constructs a `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle` from a `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleData` and the `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSchema`. Unrecognized style settings will be ignored. Unlisted style settings will be initialized with that setting's default option.

| Parameters |
|---|---|
| `userStyle: https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleData` | The `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle` represented as a `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleData`. |
| `styleSchema: https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSchema` | The `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSchema` for this UserStyle, describes how we interpret `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#(androidx.wear.watchface.style.UserStyleData,androidx.wear.watchface.style.UserStyleSchema)`. |

## Public functions

### containsKey

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
open fun [containsKey](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#containsKey(androidx.wear.watchface.style.UserStyleSetting))(key: UserStyleSetting): Boolean
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

### containsValue

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
open fun [containsValue](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#containsValue(androidx.wear.watchface.style.UserStyleSetting.Option))(value: UserStyleSetting.Option): Boolean
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

### equals

```
open operator fun [equals](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#equals(kotlin.Any))(other: Any?): Boolean
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

### get

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
open operator fun [get](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#get(androidx.wear.watchface.style.UserStyleSetting))(key: UserStyleSetting): UserStyleSetting.Option?
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Returns the `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSetting.Option` for `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#get(androidx.wear.watchface.style.UserStyleSetting)` if there is one or `null` otherwise.

### get

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
operator fun [get](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#get(androidx.wear.watchface.style.UserStyleSetting.Id))(settingId: UserStyleSetting.Id): UserStyleSetting.Option?
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Returns the `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSetting.Option` for `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#get(androidx.wear.watchface.style.UserStyleSetting.Id)` if there is one or `null` otherwise. Note this is an O(n) operation.

### hashCode

```
open fun [hashCode](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#hashCode())(): Int
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

### isEmpty

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
open fun [isEmpty](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#isEmpty())(): Boolean
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

### toMutableUserStyle

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
fun [toMutableUserStyle](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#toMutableUserStyle())(): MutableUserStyle
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Returns a mutable instance initialized with the same mapping.

### toString

```
open fun [toString](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#toString())(): String
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

### toUserStyleData

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
fun [toUserStyleData](https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyle#toUserStyleData())(): UserStyleData
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Returns the style as a `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleData`.

## Public properties

### entries

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
open val entries: Set<Map.Entry<UserStyleSetting, UserStyleSetting.Option>>
```

> [!CAUTION]
> **This property is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

### keys

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
open val keys: Set<UserStyleSetting>
```

> [!CAUTION]
> **This property is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

### size

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
open val size: Int
```

> [!CAUTION]
> **This property is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

The number of entries in the style.

### values

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
open val values: Collection<UserStyleSetting.Option>
```

> [!CAUTION]
> **This property is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff