UserStyleSetting.ComplicationSlotsUserStyleSetting.Builder


public final class UserStyleSetting.ComplicationSlotsUserStyleSetting.Builder


A Builder for ComplicationSlotsUserStyleSetting.

Summary

Public constructors

Builder(
    @NonNull UserStyleSetting.Id id,
    @NonNull List<@NonNull UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotsOption> complicationConfig,
    @NonNull Collection<@NonNull WatchFaceLayer> affectsWatchFaceLayers,
    @NonNull Resources resources,
    @StringRes int displayNameResourceId,
    @StringRes int descriptionResourceId
)

Constructs a builder for ComplicationSlotsUserStyleSetting.

Public methods

final @NonNull UserStyleSetting.ComplicationSlotsUserStyleSetting

Constructs the ComplicationSlotsUserStyleSetting.

final @NonNull UserStyleSetting.ComplicationSlotsUserStyleSetting.Builder

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

final @NonNull UserStyleSetting.ComplicationSlotsUserStyleSetting.Builder
setIcon(@NonNull Function0<Icon> iconProvider)

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

final @NonNull UserStyleSetting.ComplicationSlotsUserStyleSetting.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

public Builder(
    @NonNull UserStyleSetting.Id id,
    @NonNull List<@NonNull UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotsOption> complicationConfig,
    @NonNull Collection<@NonNull WatchFaceLayer> affectsWatchFaceLayers,
    @NonNull Resources resources,
    @StringRes int displayNameResourceId,
    @StringRes int descriptionResourceId
)

Constructs a builder for ComplicationSlotsUserStyleSetting.

Parameters
@NonNull UserStyleSetting.Id id

Id for the ComplicationSlotsUserStyleSetting, must be unique.

@NonNull List<@NonNull UserStyleSetting.ComplicationSlotsUserStyleSetting.ComplicationSlotsOption> complicationConfig

The configuration for affected complications.

@NonNull Collection<@NonNull WatchFaceLayer> affectsWatchFaceLayers

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

@NonNull Resources resources

The Resources from which displayNameResourceId and descriptionResourceId are loaded.

@StringRes int displayNameResourceId

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

@StringRes int descriptionResourceId

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

Public methods

setIcon

Added in 1.3.0-alpha05
public final @NonNull UserStyleSetting.ComplicationSlotsUserStyleSetting.Builder setIcon(@NonNull Icon icon)

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
public final @NonNull UserStyleSetting.ComplicationSlotsUserStyleSetting.Builder setIcon(@NonNull Function0<Icon> iconProvider)

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
public final @NonNull UserStyleSetting.ComplicationSlotsUserStyleSetting.Builder setWatchFaceEditorData(
    @NonNull UserStyleSetting.WatchFaceEditorData watchFaceEditorData
)

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.