UserStyleSetting.ListUserStyleSetting.ListOption


class UserStyleSetting.ListUserStyleSetting.ListOption : UserStyleSetting.Option


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

If childSettings is not empty, then an editor needs to treat this as a node in a hierarchy of editor widgets.

Summary

Nested types

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

Public constructors

ListOption(
    id: UserStyleSetting.Option.Id,
    resources: Resources,
    displayNameResourceId: @StringRes Int,
    icon: Icon?,
    watchFaceEditorData: UserStyleSetting.WatchFaceEditorData?
)

This function is deprecated. Use the Builder instead

ListOption(
    id: UserStyleSetting.Option.Id,
    resources: Resources,
    displayNameResourceId: @StringRes Int,
    icon: Icon?,
    childSettings: Collection<UserStyleSetting>,
    watchFaceEditorData: UserStyleSetting.WatchFaceEditorData?
)

This function is deprecated. Use the Builder instead

ListOption(
    id: UserStyleSetting.Option.Id,
    resources: Resources,
    displayNameResourceId: @StringRes Int,
    screenReaderNameResourceId: @StringRes Int,
    icon: Icon?,
    childSettings: Collection<UserStyleSetting>,
    watchFaceEditorData: UserStyleSetting.WatchFaceEditorData?
)

This function is deprecated. Use the Builder instead

Public properties

CharSequence

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

Icon?

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

CharSequence?

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

UserStyleSetting.WatchFaceEditorData?

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

Inherited functions

From androidx.wear.watchface.style.UserStyleSetting.Option
open operator Boolean
equals(other: Any?)

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 String

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

Inherited properties

From androidx.wear.watchface.style.UserStyleSetting.Option
Collection<UserStyleSetting>

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

UserStyleSetting.Option.Id

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

Public constructors

ListOption

Added in 1.1.0
Deprecated in 1.2.0
ListOption(
    id: UserStyleSetting.Option.Id,
    resources: Resources,
    displayNameResourceId: @StringRes Int,
    icon: Icon?,
    watchFaceEditorData: UserStyleSetting.WatchFaceEditorData? = null
)

Constructs a ListOption.

Parameters
id: UserStyleSetting.Option.Id

The Id of this ListOption, must be unique within the ListUserStyleSetting.

resources: Resources

The Resources used to load displayNameResourceId.

displayNameResourceId: @StringRes Int

String resource id for a human readable name for the element, used in the userStyle selection UI. This should be short, ideally < 20 characters. Note if the resource string contains %1$s that will get replaced with the 1-based ordinal (1st, 2nd, 3rd etc...) of the ListOption in the list of ListOptions.

icon: Icon?

Icon for use in the companion style selection UI. This gets sent to the companion over bluetooth and should be small (ideally a few kb in size)

watchFaceEditorData: UserStyleSetting.WatchFaceEditorData? = null

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.

ListOption

ListOption(
    id: UserStyleSetting.Option.Id,
    resources: Resources,
    displayNameResourceId: @StringRes Int,
    icon: Icon?,
    childSettings: Collection<UserStyleSetting> = emptyList(),
    watchFaceEditorData: UserStyleSetting.WatchFaceEditorData? = null
)

Constructs a ListOption.

Parameters
id: UserStyleSetting.Option.Id

The Id of this ListOption, must be unique within the ListUserStyleSetting.

resources: Resources

The Resources used to load displayNameResourceId.

displayNameResourceId: @StringRes Int

String resource id for a human readable name for the element, used in the userStyle selection UI. This should be short, ideally < 20 characters.

icon: Icon?

Icon for use in the style selection UI. This gets sent to the companion over bluetooth and should be small (ideally a few kb in size).

childSettings: Collection<UserStyleSetting> = emptyList()

The list of child UserStyleSettings, which may be empty. Any child settings must be listed in UserStyleSchema.userStyleSettings.

watchFaceEditorData: UserStyleSetting.WatchFaceEditorData? = null

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.

ListOption

ListOption(
    id: UserStyleSetting.Option.Id,
    resources: Resources,
    displayNameResourceId: @StringRes Int,
    screenReaderNameResourceId: @StringRes Int,
    icon: Icon?,
    childSettings: Collection<UserStyleSetting> = emptyList(),
    watchFaceEditorData: UserStyleSetting.WatchFaceEditorData? = null
)

Constructs a ListOption.

Parameters
id: UserStyleSetting.Option.Id

The Id of this ListOption, must be unique within the ListUserStyleSetting.

resources: Resources

The Resources used to load displayNameResourceId.

displayNameResourceId: @StringRes Int

String resource id for a human readable name for the element, used in the userStyle selection UI. This should be short, ideally < 20 characters. Note if the resource string contains %1$s that will get replaced with the 1-based ordinal (1st, 2nd, 3rd etc...) of the ListOption in the list of ListOptions.

screenReaderNameResourceId: @StringRes Int

String resource id for a human readable name for the element, used by screen readers. This should be more descriptive than displayNameResourceId. Note if the resource string contains %1$s that will get replaced with the 1-based ordinal (1st, 2nd, 3rd etc...) of the ListOption in the list of ListOptions. Note prior to android T this is ignored by companion editors.

icon: Icon?

Icon for use in the style selection UI. This gets sent to the companion over bluetooth and should be small (ideally a few kb in size).

childSettings: Collection<UserStyleSetting> = emptyList()

The list of child UserStyleSettings, which may be empty. Any child settings must be listed in UserStyleSchema.userStyleSettings.

watchFaceEditorData: UserStyleSetting.WatchFaceEditorData? = null

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.

Public properties

displayName

Added in 1.0.0
Deprecated in 1.3.0-alpha06
val displayNameCharSequence

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

icon

Added in 1.0.0
Deprecated in 1.3.0-alpha06
val iconIcon?

Icon for use in the companion style selection UI.

screenReaderName

Added in 1.2.0
Deprecated in 1.3.0-alpha06
val screenReaderNameCharSequence?

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.

watchFaceEditorData

Added in 1.1.0
Deprecated in 1.3.0-alpha06
val watchFaceEditorDataUserStyleSetting.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.