UserStyleSetting.ColorUserStyleSetting.ColorOption


@RequiresApi(value = 34)
public final class UserStyleSetting.ColorUserStyleSetting.ColorOption extends UserStyleSetting.Option


Represents choice within a ColorUserStyleSetting, these must be enumerated up front.

Summary

Nested types

A Builder for ColorOption.

Public methods

final @NonNull List<@NonNull Integer>

The colors for this option.

final @NonNull CharSequence

Localized human readable name for the setting, used in the editor style selection UI.

final @NonNull CharSequence

Optional localized human readable name for the setting, used by screen readers.

final UserStyleSetting.WatchFaceEditorData

Optional data for an on watch face editor, this will not be sent to the companion and its contents may be used in preference to other fields by an on watch face editor.

final void
setScreenReaderNameInternal(
    @NonNull DisplayText screenReaderNameInternal
)

Backing field for screenReaderName.

Inherited methods

From androidx.wear.watchface.style.UserStyleSetting.Option
boolean
equals(Object other)
final @NonNull Collection<@NonNull UserStyleSetting>

The list of child UserStyleSettings, if any, forming a hierarchy of UserStyleSettings.

final @NonNull UserStyleSetting.Option.Id

Machine readable Id for the style setting.

int
@NonNull String

Public methods

getColors

Added in 1.3.0-alpha05
public final @NonNull List<@NonNull IntegergetColors()

The colors for this option. The colors should be listed in order of decreasing importance. The number of provided colors must be the same for all ColorOptions in the list. The number of colors specified is up to the user, but 1 or 3 are common choices.

getDisplayName

Added in 1.3.0-alpha05
public final @NonNull CharSequence getDisplayName()

Localized human readable name for the setting, used in the editor style selection UI. This should be short (ideally < 20 characters).

getScreenReaderName

Added in 1.3.0-alpha05
public final @NonNull CharSequence getScreenReaderName()

Optional localized human readable name for the setting, used by screen readers. This should be more descriptive than displayName. Note prior to android T this is ignored by companion editors.

getWatchFaceEditorData

Added in 1.3.0-alpha05
public final UserStyleSetting.WatchFaceEditorData getWatchFaceEditorData()

Optional data for an on watch face editor, this will not be sent to the companion and its contents may be used in preference to other fields by an on watch face editor.

setScreenReaderNameInternal

public final void setScreenReaderNameInternal(
    @NonNull DisplayText screenReaderNameInternal
)

Backing field for screenReaderName.