Android 12 Developer Preview is here! Try it out, and give us your feedback!

RangedValueComplicationData

class RangedValueComplicationData : ComplicationData
kotlin.Any
   ↳ androidx.wear.complications.data.ComplicationData
   ↳ androidx.wear.complications.data.RangedValueComplicationData

Type used for complications including a numerical value within a range, such as a percentage. The value may be accompanied by an icon and/or short text and title.

The value, min, and max fields are required for this type and the value within the range is expected to always be displayed.

The icon, title, and text fields are optional and the watch face may choose which of these fields to display, if any.

Summary

Nested classes

Builder for RangedValueComplicationData.

Public methods
WireComplicationData

Boolean
isActiveAt(dateTimeMillis: Long)

Returns true if the complication is active and should be displayed at the given time.

Properties
ComplicationText?

Float

Float

MonochromaticImage?

ComplicationText?

ComplicationText?

TimeRange?

Float

Companion properties
ComplicationType

The ComplicationType corresponding to objects of this type.

Inherited properties

Public methods

asWireComplicationData

fun asWireComplicationData(): WireComplicationData

isActiveAt

fun isActiveAt(dateTimeMillis: Long): Boolean

Returns true if the complication is active and should be displayed at the given time. If this returns false, the complication should not be displayed.

This must be checked for any time for which the complication will be displayed.

Properties

contentDescription

val contentDescription: ComplicationText?

max

val max: Float

min

val min: Float

monochromaticImage

val monochromaticImage: MonochromaticImage?

text

val text: ComplicationText?

title

val title: ComplicationText?

validTimeRange

val validTimeRange: TimeRange?

value

val value: Float

Companion properties

TYPE

val TYPE: ComplicationType

The ComplicationType corresponding to objects of this type.