UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotsOption.Builder


class UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotsOption.Builder


A Builder for ComplicationSlotsOption.

Summary

Public constructors

Builder(
    id: UserStyleSetting.Option.Id,
    complicationSlotOverlays: Collection<UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay>,
    resources: Resources,
    displayNameResourceId: @StringRes Int,
    screenReaderNameResourceId: @StringRes Int
)

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

Public functions

UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotsOption

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

UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotsOption.Builder
setIcon(icon: Icon)

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

UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotsOption.Builder
setIcon(iconProvider: () -> Icon?)

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

UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotsOption.Builder

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

Public constructors

Builder

Added in 1.3.0-alpha06
Deprecated in 1.3.0-alpha06
Builder(
    id: UserStyleSetting.Option.Id,
    complicationSlotOverlays: Collection<UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay>,
    resources: Resources,
    displayNameResourceId: @StringRes Int,
    screenReaderNameResourceId: @StringRes Int
)

Constructs a builder for ComplicationSlotsOption.

Parameters
id: UserStyleSetting.Option.Id

Id for the BooleanUserStyleSetting, must be unique.

complicationSlotOverlays: Collection<UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotOverlay>

Overlays to be applied when this ComplicationSlotsOption is selected. If this is empty then the net result is the initial complication configuration.

resources: Resources

The Resources from which displayNameResourceId and screenReaderNameResourceId are loaded.

displayNameResourceId: @StringRes Int

String resource id for a human readable name for the ComplicationSlotsOption, used in the userStyle selection UI.

screenReaderNameResourceId: @StringRes Int

String resource id for a 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.

Public functions

build

Added in 1.3.0-alpha06
Deprecated in 1.3.0-alpha06
fun build(): UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotsOption

Constructs the ComplicationSlotsOption.

setIcon

Added in 1.3.0-alpha06
Deprecated in 1.3.0-alpha06
fun setIcon(icon: Icon): UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotsOption.Builder

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

setIcon

Added in 1.3.0-alpha06
Deprecated in 1.3.0-alpha06
fun setIcon(iconProvider: () -> Icon?): UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotsOption.Builder

Sets a provider of an Icon for use in the companion userStyle selection UI. This gets lazily evaluated and is sent to the companion over bluetooth and should be small (ideally a few kb in size). Note this is not guaranteed to be called on the calling thread. Note it will be called shortly after watch face initialization completes.

setWatchFaceEditorData

Added in 1.3.0-alpha06
Deprecated in 1.3.0-alpha06
fun setWatchFaceEditorData(
    watchFaceEditorData: UserStyleSetting.WatchFaceEditorData
): UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotsOption.Builder

Sets 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.