UserStyleSetting.DoubleRangeUserStyleSetting.Builder


public final class UserStyleSetting.DoubleRangeUserStyleSetting.Builder


A Builder for DoubleRangeUserStyleSetting.

Summary

Public constructors

Builder(
    @NonNull UserStyleSetting.Id id,
    double minimumValue,
    double maximumValue,
    double defaultValue,
    @NonNull Collection<@NonNull WatchFaceLayer> affectsWatchFaceLayers,
    @NonNull Resources resources,
    @StringRes int displayNameResourceId,
    @StringRes int descriptionResourceId
)

Constructs a builder for DoubleRangeUserStyleSetting.

Public methods

final @NonNull UserStyleSetting.DoubleRangeUserStyleSetting

Constructs the DoubleRangeUserStyleSetting.

final @NonNull UserStyleSetting.DoubleRangeUserStyleSetting.Builder

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

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

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

final @NonNull UserStyleSetting.DoubleRangeUserStyleSetting.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,
    double minimumValue,
    double maximumValue,
    double defaultValue,
    @NonNull Collection<@NonNull WatchFaceLayer> affectsWatchFaceLayers,
    @NonNull Resources resources,
    @StringRes int displayNameResourceId,
    @StringRes int descriptionResourceId
)

Constructs a builder for DoubleRangeUserStyleSetting.

Parameters
@NonNull UserStyleSetting.Id id

Id for the BooleanUserStyleSetting, must be unique.

double minimumValue

Minimum value (inclusive).

double maximumValue

Maximum value (inclusive).

double defaultValue

The default value for the constructed DoubleRangeUserStyleSetting.

@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 DoubleRangeUserStyleSetting, 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.DoubleRangeUserStyleSetting.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.DoubleRangeUserStyleSetting.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.DoubleRangeUserStyleSetting.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.