# MutableUserStyle

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.MutableUserStyle) 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)

*** ** * ** ***


```
public final class MutableUserStyle implements Iterable<@NonNull Map.Entry<@NonNull UserStyleSetting, @NonNull 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

A mutable `https://developer.android.com/reference/androidx/wear/watchface/style/UserStyle`. This must be converted back to a `https://developer.android.com/reference/androidx/wear/watchface/style/UserStyle` by calling `https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#toUserStyle()`.

use Watch Face Format instead

## Summary

| ### Public methods |
|---|---|
| `final https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting.Option` | `[get](https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#get(androidx.wear.watchface.style.UserStyleSetting.Id))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting.Id settingId)` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `final https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting.Option` | `[get](https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#get(androidx.wear.watchface.style.UserStyleSetting))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting setting)` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `final int` | `[getSize](https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#getSize())()` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Iterator.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.Entry.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting.Option>>` | `[iterator](https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#iterator())()` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `final void` | `[set](https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting.Id,androidx.wear.watchface.style.UserStyleSetting.Option.Id))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting.Id settingId, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting.Option.Id optionId )` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `final void` | `[set](https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting.Id,androidx.wear.watchface.style.UserStyleSetting.Option))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting.Id settingId, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting.Option option )` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `final void` | `[set](https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting,androidx.wear.watchface.style.UserStyleSetting.Option.Id))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting setting, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting.Option.Id optionId )` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `final void` | `[set](https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting,androidx.wear.watchface.style.UserStyleSetting.Option))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting setting, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting.Option option )` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `[toString](https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#toString())()` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/style/UserStyle` | `[toUserStyle](https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#toUserStyle())()` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |

### Inherited methods

From [kotlin.collections.Iterable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterable/index.html) `void` `[forEach](https://developer.android.com/reference/java/lang/Iterable.html#forEach(java.util.function.Consumer&lt;? super T&gt;))(
@https://developer.android.com/reference/androidx/annotation/RecentlyNonNull @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/function/Consumer.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.Entry.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting.Option>> action
)`

**This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead.
`@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Spliterator.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.Entry.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting.Option>>` `@https://developer.android.com/reference/androidx/annotation/RecentlyNonNull
[spliterator](https://developer.android.com/reference/java/lang/Iterable.html#spliterator())()`

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

## Public methods

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

```
public final UserStyleSetting.Option [get](https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#get(androidx.wear.watchface.style.UserStyleSetting.Id))(@NonNull UserStyleSetting.Id settingId)
```

> [!CAUTION]
> **This method 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/androidx/wear/watchface/style/UserStyleSetting.Option` for `https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#get(androidx.wear.watchface.style.UserStyleSetting.Id)` if there is one or `null` otherwise. Note this is an O(n) operation.

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

```
public final UserStyleSetting.Option [get](https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#get(androidx.wear.watchface.style.UserStyleSetting))(@NonNull UserStyleSetting setting)
```

> [!CAUTION]
> **This method 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/androidx/wear/watchface/style/UserStyleSetting.Option` for `https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#get(androidx.wear.watchface.style.UserStyleSetting)` if there is one or `null` otherwise.

### getSize

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)

```
public final int [getSize](https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#getSize())()
```

> [!CAUTION]
> **This method 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.

### iterator

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)

```
public @NonNull Iterator<@NonNull Map.Entry<@NonNull UserStyleSetting, @NonNull UserStyleSetting.Option>> [iterator](https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#iterator())()
```

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

Iterator over the elements of the user style.

### set

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)

```
public final void [set](https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting.Id,androidx.wear.watchface.style.UserStyleSetting.Option.Id))(
    @NonNull UserStyleSetting.Id settingId,
    @NonNull UserStyleSetting.Option.Id optionId
)
```

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

Sets the `https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting.Option` for the setting with the given `https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting.Id,androidx.wear.watchface.style.UserStyleSetting.Option.Id)` to the option with the given `https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting.Id,androidx.wear.watchface.style.UserStyleSetting.Option.Id)`.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if `https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting.Id,androidx.wear.watchface.style.UserStyleSetting.Option.Id)` is not in the schema or if `https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting.Id,androidx.wear.watchface.style.UserStyleSetting.Option.Id)` is unrecognized. |

### set

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)

```
public final void [set](https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting.Id,androidx.wear.watchface.style.UserStyleSetting.Option))(
    @NonNull UserStyleSetting.Id settingId,
    @NonNull UserStyleSetting.Option option
)
```

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

Sets the `https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting.Option` for the setting with the given `https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting.Id,androidx.wear.watchface.style.UserStyleSetting.Option)` to the given `https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting.Id,androidx.wear.watchface.style.UserStyleSetting.Option)`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting.Id settingId` | The `https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting.Id` of the `https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting` we're setting the `https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting.Id,androidx.wear.watchface.style.UserStyleSetting.Option)` for, must be in the schema. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting.Option option` | the `https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting.Option` we're setting. Must be a valid option for `https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting.Id,androidx.wear.watchface.style.UserStyleSetting.Option)`. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if `https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting.Id,androidx.wear.watchface.style.UserStyleSetting.Option)` is not in the schema or if `https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting.Id,androidx.wear.watchface.style.UserStyleSetting.Option)` is invalid for `https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting.Id,androidx.wear.watchface.style.UserStyleSetting.Option)`. |

### set

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)

```
public final void [set](https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting,androidx.wear.watchface.style.UserStyleSetting.Option.Id))(
    @NonNull UserStyleSetting setting,
    @NonNull UserStyleSetting.Option.Id optionId
)
```

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

Sets the `https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting.Option` for `https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting,androidx.wear.watchface.style.UserStyleSetting.Option.Id)` to the option with the given `https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting,androidx.wear.watchface.style.UserStyleSetting.Option.Id)`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting setting` | The `https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting` we're setting the `https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting,androidx.wear.watchface.style.UserStyleSetting.Option.Id)` for, must be in the schema. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting.Option.Id optionId` | the `https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting.Option.Id` for the `https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting.Option` we're setting. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if `https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting,androidx.wear.watchface.style.UserStyleSetting.Option.Id)` is not in the schema or if `https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting,androidx.wear.watchface.style.UserStyleSetting.Option.Id)` is unrecognized. |

### set

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)

```
public final void [set](https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting,androidx.wear.watchface.style.UserStyleSetting.Option))(
    @NonNull UserStyleSetting setting,
    @NonNull UserStyleSetting.Option option
)
```

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

Sets the `https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting.Option` for `https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting,androidx.wear.watchface.style.UserStyleSetting.Option)` to the given `https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting,androidx.wear.watchface.style.UserStyleSetting.Option)`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting setting` | The `https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting` we're setting the `https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting,androidx.wear.watchface.style.UserStyleSetting.Option)` for, must be in the schema. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting.Option option` | the `https://developer.android.com/reference/androidx/wear/watchface/style/UserStyleSetting.Option` we're setting. Must be a valid option for `https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting,androidx.wear.watchface.style.UserStyleSetting.Option)`. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if `https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting,androidx.wear.watchface.style.UserStyleSetting.Option)` is not in the schema or if `https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting,androidx.wear.watchface.style.UserStyleSetting.Option)` is invalid for `https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#set(androidx.wear.watchface.style.UserStyleSetting,androidx.wear.watchface.style.UserStyleSetting.Option)`. |

### toString

```
public @NonNull String [toString](https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#toString())()
```

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

### toUserStyle

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)

```
public final @NonNull UserStyle [toUserStyle](https://developer.android.com/reference/androidx/wear/watchface/style/MutableUserStyle#toUserStyle())()
```

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

Converts this instance to an immutable `https://developer.android.com/reference/androidx/wear/watchface/style/UserStyle` with the same mapping.