UserStyleSetting.BooleanUserStyleSetting.Builder


class UserStyleSetting.BooleanUserStyleSetting.Builder


A Builder for BooleanUserStyleSetting.

Summary

Public constructors

Builder(
    id: UserStyleSetting.Id,
    affectsWatchFaceLayers: Collection<WatchFaceLayer>,
    defaultValue: Boolean,
    resources: Resources,
    displayNameResourceId: @StringRes Int,
    descriptionResourceId: @StringRes Int
)

Constructs a builder for BooleanUserStyleSetting.

Public functions

UserStyleSetting.BooleanUserStyleSetting

Constructs the BooleanUserStyleSetting.

UserStyleSetting.BooleanUserStyleSetting.Builder
setIcon(icon: Icon)

Sets an Icon for use in the companion userStyle selection UI.

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

Sets a provider of an Icon for use in the companion userStyle selection UI.

UserStyleSetting.BooleanUserStyleSetting.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.

Public constructors

Builder

Builder(
    id: UserStyleSetting.Id,
    affectsWatchFaceLayers: Collection<WatchFaceLayer>,
    defaultValue: Boolean,
    resources: Resources,
    displayNameResourceId: @StringRes Int,
    descriptionResourceId: @StringRes Int
)

Constructs a builder for BooleanUserStyleSetting.

Parameters
id: UserStyleSetting.Id

Id for the BooleanUserStyleSetting, must be unique.

affectsWatchFaceLayers: Collection<WatchFaceLayer>

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

defaultValue: Boolean

The default value of the BooleanUserStyleSetting.

resources: Resources

The Resources from which displayNameResourceId and descriptionResourceId are loaded.

displayNameResourceId: @StringRes Int

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

descriptionResourceId: @StringRes Int

String resource id for a human readable description displayed under the displayName in the userStyle selection UI.

Public functions

setIcon

Added in 1.3.0-alpha05
fun setIcon(icon: Icon): UserStyleSetting.BooleanUserStyleSetting.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-alpha05
fun setIcon(iconProvider: () -> Icon?): UserStyleSetting.BooleanUserStyleSetting.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-alpha05
fun setWatchFaceEditorData(
    watchFaceEditorData: UserStyleSetting.WatchFaceEditorData
): UserStyleSetting.BooleanUserStyleSetting.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.