UserStyleSetting.CustomValueUserStyleSetting


public final class UserStyleSetting.CustomValueUserStyleSetting extends UserStyleSetting


An application specific style setting. This style is ignored by the system editor. This is expected to be used in conjunction with an on watch face editor. Only a single ComplicationSlotsUserStyleSetting or LargeCustomValueUserStyleSetting is permitted in the UserStyleSchema.

The CustomValueOption can store at most Option.Id.MAX_LENGTH bytes. If you need more storage, consider using LargeCustomValueUserStyleSetting.

Summary

Nested types

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

Public constructors

CustomValueUserStyleSetting(
    @NonNull Collection<@NonNull WatchFaceLayer> affectsWatchFaceLayers,
    @NonNull byte[] defaultValue
)

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

Public methods

@NonNull UserStyleSetting.Option

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

Inherited methods

From androidx.wear.watchface.style.UserStyleSetting
boolean
equals(Object other)

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

final @NonNull Collection<@NonNull WatchFaceLayer>

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

final @NonNull UserStyleSetting.Option

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

final int

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

final @NonNull CharSequence

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

final @NonNull CharSequence

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

final Icon

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

final @NonNull UserStyleSetting.Id

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

final @NonNull List<@NonNull UserStyleSetting.Option>

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

final UserStyleSetting.WatchFaceEditorData

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

int

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

@NonNull String

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

Public constructors

CustomValueUserStyleSetting

public CustomValueUserStyleSetting(
    @NonNull Collection<@NonNull WatchFaceLayer> affectsWatchFaceLayers,
    @NonNull byte[] defaultValue
)

Constructs a CustomValueUserStyleSetting.

Parameters
@NonNull Collection<@NonNull WatchFaceLayer> affectsWatchFaceLayers

Used by the style configuration UI. Describes which watch face rendering layers this style affects.

@NonNull byte[] defaultValue

The default value ByteArray.

Public methods

getOptionForId

public @NonNull UserStyleSetting.Option getOptionForId(@NonNull UserStyleSetting.Option.Id optionId)

Translates an option name into an option. This will need to be overridden for userStyle categories that can't sensibly be fully enumerated (e.g. a full 24-bit color picker).

Parameters
@NonNull UserStyleSetting.Option.Id optionId

The Option.Id of the option

Returns
@NonNull UserStyleSetting.Option

An Option corresponding to the name. This could either be one of the options from UserStyleSettings or a newly constructed Option depending on the nature of the UserStyleSetting. If optionName is unrecognized then the default value for the setting should be returned.