RangedValueComplicationData.Builder

public final class RangedValueComplicationData.Builder


Builder for RangedValueComplicationData.

You must at a minimum set the value, min, max and contentDescription fields.

Summary

Public constructors

Builder(
    float value,
    float min,
    float max,
    ComplicationText contentDescription
)

Public methods

final @NonNull RangedValueComplicationData

Builds the RangedValueComplicationData.

final @NonNull RangedValueComplicationData.Builder

Sets optional icon associated with the complication data.

final @NonNull RangedValueComplicationData.Builder

Sets optional pending intent to be invoked when the complication is tapped.

final @NonNull RangedValueComplicationData.Builder

Sets optional title associated with the complication data.

final @NonNull RangedValueComplicationData.Builder

Sets optional title associated with the complication data.

final @NonNull RangedValueComplicationData.Builder
setValidTimeRange(TimeRange validTimeRange)

Sets optional time range during which the complication has to be shown.

Public constructors

Builder

public final Builder(
    float value,
    float min,
    float max,
    ComplicationText contentDescription
)
Parameters
float value

The value of the ranged complication which should be in the range [min] .. [max]

float min

The minimum value

float max

The maximum value

ComplicationText contentDescription

Localized description for use by screen readers

Public methods

setMonochromaticImage

public final @NonNull RangedValueComplicationData.Builder setMonochromaticImage(MonochromaticImage monochromaticImage)

Sets optional icon associated with the complication data.

setTapAction

public final @NonNull RangedValueComplicationData.Builder setTapAction(PendingIntent tapAction)

Sets optional pending intent to be invoked when the complication is tapped.

setText

public final @NonNull RangedValueComplicationData.Builder setText(ComplicationText text)

Sets optional title associated with the complication data.

setTitle

public final @NonNull RangedValueComplicationData.Builder setTitle(ComplicationText title)

Sets optional title associated with the complication data.

setValidTimeRange

public final @NonNull RangedValueComplicationData.Builder setValidTimeRange(TimeRange validTimeRange)

Sets optional time range during which the complication has to be shown.