WeightedElementsComplicationData.Element

public final class WeightedElementsComplicationData.Element


Describes a single value within a WeightedElementsComplicationData.

Summary

Public constructors

Element(
    @FloatRange(from = 0.0, fromInclusive = false) float weight,
    @ColorInt int color
)

Public methods

boolean
equals(Object other)
final int

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

final float

The weight of the Element which must be zero.

int
@NonNull String

Public constructors

Element

Added in 1.2.0
public Element(
    @FloatRange(from = 0.0, fromInclusive = false) float weight,
    @ColorInt int color
)

Public methods

equals

public boolean equals(Object other)

getColor

Added in 1.2.0
public final int getColor()

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.

getWeight

Added in 1.2.0
public final float getWeight()

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.

hashCode

public int hashCode()

toString

public @NonNull String toString()