UserStyleSetting.DoubleRangeUserStyleSetting


class UserStyleSetting.DoubleRangeUserStyleSetting : UserStyleSetting


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

Summary

Nested types

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

Public constructors

DoubleRangeUserStyleSetting(
    id: UserStyleSetting.Id,
    resources: Resources,
    displayNameResourceId: @StringRes Int,
    descriptionResourceId: @StringRes Int,
    icon: Icon?,
    minimumValue: Double,
    maximumValue: Double,
    affectsWatchFaceLayers: Collection<WatchFaceLayer>,
    defaultValue: Double,
    watchFaceEditorData: UserStyleSetting.WatchFaceEditorData?
)

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

DoubleRangeUserStyleSetting(
    id: UserStyleSetting.Id,
    resources: Resources,
    displayNameResourceId: @StringRes Int,
    descriptionResourceId: @StringRes Int,
    iconProvider: () -> Icon,
    minimumValue: Double,
    maximumValue: Double,
    affectsWatchFaceLayers: Collection<WatchFaceLayer>,
    defaultValue: Double,
    watchFaceEditorData: UserStyleSetting.WatchFaceEditorData?
)

Constructs a DoubleRangeUserStyleSetting with a lazily evaluated Icon, where DoubleRangeUserStyleSetting.displayName and DoubleRangeUserStyleSetting.description are specified as resources.

Public functions

open UserStyleSetting.Option

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

Public properties

Double

Returns the default value.

Double

Returns the maximum value.

Double

Returns the minimum value.

Inherited functions

From androidx.wear.watchface.style.UserStyleSetting
open operator Boolean
equals(other: Any?)
open Int
open String

Inherited properties

From androidx.wear.watchface.style.UserStyleSetting
Collection<WatchFaceLayer>

Used by the style configuration UI.

UserStyleSetting.Option

Returns the default for when the user hasn't selected an option.

Int

The default option index, used if nothing has been selected within the options list.

CharSequence

Localized description string displayed under the displayName.

CharSequence

Localized human readable name for the element, used in the userStyle selection UI.

Icon?

Icon for use in the companion editor style selection UI.

UserStyleSetting.Id

Identifier for the element, must be unique.

List<UserStyleSetting.Option>

List of options for this UserStyleSetting.

UserStyleSetting.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 constructors

DoubleRangeUserStyleSetting

DoubleRangeUserStyleSetting(
    id: UserStyleSetting.Id,
    resources: Resources,
    displayNameResourceId: @StringRes Int,
    descriptionResourceId: @StringRes Int,
    icon: Icon?,
    minimumValue: Double,
    maximumValue: Double,
    affectsWatchFaceLayers: Collection<WatchFaceLayer>,
    defaultValue: Double,
    watchFaceEditorData: UserStyleSetting.WatchFaceEditorData? = null
)

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

Parameters
id: UserStyleSetting.Id

Id for the element, must be unique.

resources: Resources

The Resources from which displayNameResourceId and descriptionResourceId are loaded.

displayNameResourceId: @StringRes Int

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

descriptionResourceId: @StringRes Int

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

minimumValue: Double

Minimum value (inclusive).

maximumValue: Double

Maximum value (inclusive).

affectsWatchFaceLayers: Collection<WatchFaceLayer>

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

defaultValue: Double

The default value for this DoubleRangeUserStyleSetting.

watchFaceEditorData: UserStyleSetting.WatchFaceEditorData? = null

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.

DoubleRangeUserStyleSetting

DoubleRangeUserStyleSetting(
    id: UserStyleSetting.Id,
    resources: Resources,
    displayNameResourceId: @StringRes Int,
    descriptionResourceId: @StringRes Int,
    iconProvider: () -> Icon,
    minimumValue: Double,
    maximumValue: Double,
    affectsWatchFaceLayers: Collection<WatchFaceLayer>,
    defaultValue: Double,
    watchFaceEditorData: UserStyleSetting.WatchFaceEditorData? = null
)

Constructs a DoubleRangeUserStyleSetting with a lazily evaluated Icon, where DoubleRangeUserStyleSetting.displayName and DoubleRangeUserStyleSetting.description are specified as resources.

Parameters
id: UserStyleSetting.Id

Id for the element, must be unique.

resources: Resources

The Resources from which displayNameResourceId and descriptionResourceId are loaded.

displayNameResourceId: @StringRes Int

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

descriptionResourceId: @StringRes Int

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

iconProvider: () -> Icon

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.

minimumValue: Double

Minimum value (inclusive).

maximumValue: Double

Maximum value (inclusive).

affectsWatchFaceLayers: Collection<WatchFaceLayer>

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

defaultValue: Double

The default value for this DoubleRangeUserStyleSetting.

watchFaceEditorData: UserStyleSetting.WatchFaceEditorData? = null

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 functions

getOptionForId

open fun getOptionForId(optionId: UserStyleSetting.Option.Id): UserStyleSetting.Option

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

Public properties

defaultValue

Added in 1.0.0
val defaultValueDouble

Returns the default value.

maximumValue

Added in 1.0.0
val maximumValueDouble

Returns the maximum value.

minimumValue

Added in 1.0.0
val minimumValueDouble

Returns the minimum value.