WeightedElementsComplicationData.Element


class WeightedElementsComplicationData.Element


Describes a single value within a WeightedElementsComplicationData.

Summary

Public constructors

Element(
    weight: @FloatRange(from = 0.0, fromInclusive = false) Float,
    color: @ColorInt Int
)

Public functions

open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

Int

The color of the Element, which must be used instead of the watch face's colors.

Float

The weight of the Element which must be zero.

Public constructors

Element

Added in 1.2.0
Element(
    weight: @FloatRange(from = 0.0, fromInclusive = false) Float,
    color: @ColorInt Int
)

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

color

Added in 1.2.0
val colorInt

The color of the Element, which must be used instead of the watch face's colors. This color needs to be meaningful to the user in conjunction with the other fields (e.g. blue is cold, red/yellow is warm). Tapping on the complication should launch an experience where the data is presented in more detail. Care must be taken to ensure the colors used are consistent with the launched experience.

weight

Added in 1.2.0
val weightFloat

The weight of the Element which must be zero. The size of the element when rendered should be proportional to its weight. Weights are not required to sum to any particular value.