UserStyleSetting.DoubleRangeUserStyleSetting

public final class UserStyleSetting.DoubleRangeUserStyleSetting extends UserStyleSetting


A DoubleRangeUserStyleSetting represents a setting with a Double value in the range [minimumValue .. maximumValue].

Summary

Nested types

UserStyleSetting.DoubleRangeUserStyleSetting.DoubleRangeOption

Represents an option as a Double in the range minimumValue ..

Public fields

final double

Returns the default value.

final double

Returns the maximum value.

final double

Returns the minimum value.

Public constructors

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

Constructs a DoubleRangeUserStyleSetting where DoubleRangeUserStyleSetting.displayName and DoubleRangeUserStyleSetting.description are specified as resources.

Public methods

@NonNull UserStyleSetting.Option

We support all values in the range min ...

Inherited methods

From class UserStyleSetting
boolean
equals(Object other)
int
@NonNull String

Public fields

defaultValue

public final double defaultValue

Returns the default value.

maximumValue

public final double maximumValue

Returns the maximum value.

minimumValue

public final double minimumValue

Returns the minimum value.

Public constructors

DoubleRangeUserStyleSetting

public final DoubleRangeUserStyleSetting(
    UserStyleSetting.Id id,
    Resources resources,
    @StringRes int displayNameResourceId,
    @StringRes int descriptionResourceId,
    Icon icon,
    double minimumValue,
    double maximumValue,
    Collection<WatchFaceLayer> affectsWatchFaceLayers,
    double defaultValue
)

Constructs a DoubleRangeUserStyleSetting where DoubleRangeUserStyleSetting.displayName and DoubleRangeUserStyleSetting.description are specified as resources.

Parameters
UserStyleSetting.Id id

Id for the element, must be unique.

Resources resources

The Resources from which displayNameResourceId and descriptionResourceId are loaded.

@StringRes int displayNameResourceId

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

@StringRes int descriptionResourceId

String resource id for a human readable description string displayed under the displayName.

Icon icon

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

double minimumValue

Minimum value (inclusive).

double maximumValue

Maximum value (inclusive).

Collection<WatchFaceLayer> affectsWatchFaceLayers

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

double defaultValue

The default value for this DoubleRangeUserStyleSetting.

Public methods

getOptionForId

public @NonNull UserStyleSetting.Option getOptionForId(UserStyleSetting.Option.Id optionId)

We support all values in the range min ... max not just min & max.