UserStyle


class UserStyle : Map


An immutable representation of user style choices that maps each UserStyleSetting to UserStyleSetting.Option.

This is intended for use by the WatchFace and entries are the same as the ones specified in the UserStyleSchema. This means you can't serialize a UserStyle directly, instead you need to use a UserStyleData (see toUserStyleData).

To modify the user style, you should call toMutableUserStyle and construct a new UserStyle instance with MutableUserStyle.toUserStyle.

use Watch Face Format instead

Summary

Public constructors

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

UserStyle(userStyle: UserStyle)

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

UserStyle(userStyle: UserStyleData, styleSchema: UserStyleSchema)

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

Public functions

open Boolean

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

open Boolean

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

open operator Boolean
equals(other: Any?)

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

open operator UserStyleSetting.Option?

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

operator UserStyleSetting.Option?

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

open Int

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

open Boolean

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

MutableUserStyle

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

open String

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

UserStyleData

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

Public properties

open Set<Map.Entry<UserStyleSettingUserStyleSetting.Option>>

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

open Set<UserStyleSetting>

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

open Int

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

open Collection<UserStyleSetting.Option>

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

Inherited functions

From kotlin.collections.Map
open Unit

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

open UserStyleSetting.Option
@SinceKotlin(version = "1.1")
@PlatformDependent
getOrDefault(
    key: UserStyleSetting,
    defaultValue: UserStyleSetting.Option
)

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

Public constructors

UserStyle

UserStyle(
    selectedOptions: Map<UserStyleSettingUserStyleSetting.Option>
)

Constructs a UserStyle with the given selected options for each setting.

A copy of the selectedOptions map will be created, so that changed to the map will not be reflected by this object.

Parameters
selectedOptions: Map<UserStyleSettingUserStyleSetting.Option>

The UserStyleSetting.Option selected for each UserStyleSetting

UserStyle

Added in 1.0.0
Deprecated in 1.3.0-alpha06
UserStyle(userStyle: UserStyle)

Constructs a copy of the UserStyle. It is backed by the same map.

UserStyle

Added in 1.0.0
Deprecated in 1.3.0-alpha06
UserStyle(userStyle: UserStyleData, styleSchema: UserStyleSchema)

Constructs a UserStyle from a UserStyleData and the UserStyleSchema. Unrecognized style settings will be ignored. Unlisted style settings will be initialized with that setting's default option.

Parameters
userStyle: UserStyleData

The UserStyle represented as a UserStyleData.

styleSchema: UserStyleSchema

The UserStyleSchema for this UserStyle, describes how we interpret userStyle.

Public functions

containsKey

Added in 1.0.0
Deprecated in 1.3.0-alpha06
open fun containsKey(key: UserStyleSetting): Boolean

containsValue

Added in 1.0.0
Deprecated in 1.3.0-alpha06
open fun containsValue(value: UserStyleSetting.Option): Boolean

equals

open operator fun equals(other: Any?): Boolean

get

Added in 1.0.0
Deprecated in 1.3.0-alpha06
open operator fun get(key: UserStyleSetting): UserStyleSetting.Option?

Returns the UserStyleSetting.Option for key if there is one or null otherwise.

get

Added in 1.0.0
Deprecated in 1.3.0-alpha06
operator fun get(settingId: UserStyleSetting.Id): UserStyleSetting.Option?

Returns the UserStyleSetting.Option for settingId if there is one or null otherwise. Note this is an O(n) operation.

hashCode

open fun hashCode(): Int

isEmpty

Added in 1.0.0
Deprecated in 1.3.0-alpha06
open fun isEmpty(): Boolean

toMutableUserStyle

Added in 1.0.0
Deprecated in 1.3.0-alpha06
fun toMutableUserStyle(): MutableUserStyle

Returns a mutable instance initialized with the same mapping.

toString

open fun toString(): String

toUserStyleData

Added in 1.0.0
Deprecated in 1.3.0-alpha06
fun toUserStyleData(): UserStyleData

Returns the style as a UserStyleData.

Public properties

entries

Added in 1.0.0
Deprecated in 1.3.0-alpha06
open val entriesSet<Map.Entry<UserStyleSettingUserStyleSetting.Option>>

keys

Added in 1.0.0
Deprecated in 1.3.0-alpha06
open val keysSet<UserStyleSetting>

size

Added in 1.0.0
Deprecated in 1.3.0-alpha06
open val sizeInt

The number of entries in the style.

values

Added in 1.0.0
Deprecated in 1.3.0-alpha06
open val valuesCollection<UserStyleSetting.Option>