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

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

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

Public constructors

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

This method is deprecated. Use the Builder instead

Public methods

final double

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

final double

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

final double

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

@NonNull UserStyleSetting.Option

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

Inherited methods

From androidx.wear.watchface.style.UserStyleSetting
boolean
equals(Object other)

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

final @NonNull Collection<@NonNull WatchFaceLayer>

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

final @NonNull UserStyleSetting.Option

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

final int

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

final @NonNull CharSequence

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

final @NonNull CharSequence

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

final Icon

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

final @NonNull UserStyleSetting.Id

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

final @NonNull List<@NonNull UserStyleSetting.Option>

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

final UserStyleSetting.WatchFaceEditorData

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

int

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

@NonNull String

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

Public constructors

DoubleRangeUserStyleSetting

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

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

Parameters
@NonNull UserStyleSetting.Id id

Id for the element, must be unique.

@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 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 companion 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).

@NonNull Collection<@NonNull 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.

UserStyleSetting.WatchFaceEditorData watchFaceEditorData

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 methods

getDefaultValue

Added in 1.0.0
Deprecated in 1.3.0-alpha06
public final double getDefaultValue()

Returns the default value.

getMaximumValue

Added in 1.0.0
Deprecated in 1.3.0-alpha06
public final double getMaximumValue()

Returns the maximum value.

getMinimumValue

Added in 1.0.0
Deprecated in 1.3.0-alpha06
public final double getMinimumValue()

Returns the minimum value.

getOptionForId

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

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