UserStyleSetting.ListUserStyleSetting.Builder


class UserStyleSetting.ListUserStyleSetting.Builder


A Builder for ListUserStyleSetting.

Summary

Public constructors

Builder(
    id: UserStyleSetting.Id,
    options: List<UserStyleSetting.ListUserStyleSetting.ListOption>,
    affectsWatchFaceLayers: Collection<WatchFaceLayer>,
    resources: Resources,
    displayNameResourceId: @StringRes Int,
    descriptionResourceId: @StringRes Int
)

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

Public functions

UserStyleSetting.ListUserStyleSetting

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

UserStyleSetting.ListUserStyleSetting.Builder

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

UserStyleSetting.ListUserStyleSetting.Builder
setIcon(icon: Icon)

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

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

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

UserStyleSetting.ListUserStyleSetting.Builder

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

Public constructors

Builder

Builder(
    id: UserStyleSetting.Id,
    options: List<UserStyleSetting.ListUserStyleSetting.ListOption>,
    affectsWatchFaceLayers: Collection<WatchFaceLayer>,
    resources: Resources,
    displayNameResourceId: @StringRes Int,
    descriptionResourceId: @StringRes Int
)

Constructs a builder for ListUserStyleSetting.

Parameters
id: UserStyleSetting.Id

Id for the ListUserStyleSetting, must be unique.

options: List<UserStyleSetting.ListUserStyleSetting.ListOption>

: List,

affectsWatchFaceLayers: Collection<WatchFaceLayer>

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

resources: Resources

The Resources from which displayNameResourceId and descriptionResourceId are loaded.

displayNameResourceId: @StringRes Int

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

descriptionResourceId: @StringRes Int

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

Public functions

build

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

Constructs the ListUserStyleSetting.

setDefaultOption

Added in 1.3.0-alpha06
Deprecated in 1.3.0-alpha06
fun setDefaultOption(
    defaultOption: UserStyleSetting.ListUserStyleSetting.ListOption
): UserStyleSetting.ListUserStyleSetting.Builder

Sets the default option. If not specified, the default will be the first element of options.

Parameters
defaultOption: UserStyleSetting.ListUserStyleSetting.ListOption

The default option, used when data isn't persisted.

setIcon

Added in 1.3.0-alpha06
Deprecated in 1.3.0-alpha06
fun setIcon(icon: Icon): UserStyleSetting.ListUserStyleSetting.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.ListUserStyleSetting.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.ListUserStyleSetting.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.