GoalProgressComplicationData.Builder


@RequiresApi(value = 33)
class GoalProgressComplicationData.Builder


Builder for GoalProgressComplicationData.

You must at a minimum set the targetValue and contentDescription fields, one of value or dynamicValue, and at least one of monochromaticImage, smallImage, text or title.

Summary

Public constructors

@RequiresApi(value = 34)
Builder(
    dynamicValue: DynamicBuilders.DynamicFloat,
    targetValue: Float,
    contentDescription: ComplicationText
)

Creates a Builder for a RangedValueComplicationData with a DynamicFloat value, and no fallbackValue for API levels known to support dynamic values.

Builder(
    value: Float,
    targetValue: Float,
    contentDescription: ComplicationText
)

Creates a Builder for a GoalProgressComplicationData with a Float value.

@RequiresApi(value = 33)
Builder(
    dynamicValue: DynamicBuilders.DynamicFloat,
    fallbackValue: Float,
    targetValue: Float,
    contentDescription: ComplicationText
)

Creates a Builder for a GoalProgressComplicationData with a DynamicFloat value.

Public functions

open GoalProgressComplicationData

Builds the GoalProgressComplicationData.

GoalProgressComplicationData.Builder
setColorRamp(colorRamp: ColorRamp?)

Sets an optional hint which suggests the renderer draws the complication using a ColorRamp.

GoalProgressComplicationData.Builder

Sets optional icon associated with the complication data.

GoalProgressComplicationData.Builder
setSmallImage(smallImage: SmallImage?)

Sets optional image associated with the complication data.

GoalProgressComplicationData.Builder

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

GoalProgressComplicationData.Builder

Sets optional text associated with the complication data.

GoalProgressComplicationData.Builder

Sets optional title associated with the complication data.

GoalProgressComplicationData.Builder
setValidTimeRange(validTimeRange: TimeRange?)

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

Public constructors

Builder

Added in 1.3.0-alpha04
@RequiresApi(value = 34)
Builder(
    dynamicValue: DynamicBuilders.DynamicFloat,
    targetValue: Float,
    contentDescription: ComplicationText
)

Creates a Builder for a RangedValueComplicationData with a DynamicFloat value, and no fallbackValue for API levels known to support dynamic values.

Parameters
dynamicValue: DynamicBuilders.DynamicFloat

The DynamicFloat of the goal complication which will be evaluated into a value dynamically, and should be >= 0.

targetValue: Float

The target value. This must be less than Float.MAX_VALUE.

contentDescription: ComplicationText

Defines localized text that briefly describes content of the complication. This property is used primarily for accessibility. Since some complications do not have textual representation this attribute can be used for providing such. Please do not include the word 'complication' in the description.

Builder

Added in 1.2.0
Builder(
    value: Float,
    targetValue: Float,
    contentDescription: ComplicationText
)

Creates a Builder for a GoalProgressComplicationData with a Float value.

Parameters
value: Float

The value of the goal complication which should be >= 0.

targetValue: Float

The target value. This must be less than Float.MAX_VALUE.

contentDescription: ComplicationText

Defines localized text that briefly describes content of the complication. This property is used primarily for accessibility. Since some complications do not have textual representation this attribute can be used for providing such. Please do not include the word 'complication' in the description.

Builder

Added in 1.2.0
@RequiresApi(value = 33)
Builder(
    dynamicValue: DynamicBuilders.DynamicFloat,
    fallbackValue: Float,
    targetValue: Float,
    contentDescription: ComplicationText
)

Creates a Builder for a GoalProgressComplicationData with a DynamicFloat value.

Parameters
dynamicValue: DynamicBuilders.DynamicFloat

The DynamicFloat of the goal complication which will be evaluated into a value dynamically, and should be >= 0.

fallbackValue: Float

The fallback value of the goal complication which will be used on systems that don't support dynamicValue, and should be >= 0.

This is only relevant before Build.VERSION_CODES.UPSIDE_DOWN_CAKE, use the no-fallback constructor if you target an equal or higher API level.

IMPORTANT: This is only used when the system does not support dynamicValue at all. See setDynamicValueInvalidationFallback for the situation where the dynamicValue cannot be evaluated, e.g. when a data source is not available.

targetValue: Float

The target value. This must be less than Float.MAX_VALUE.

contentDescription: ComplicationText

Defines localized text that briefly describes content of the complication. This property is used primarily for accessibility. Since some complications do not have textual representation this attribute can be used for providing such. Please do not include the word 'complication' in the description.

Public functions

build

Added in 1.2.0
open fun build(): GoalProgressComplicationData

Builds the GoalProgressComplicationData.

setColorRamp

Added in 1.2.0
fun setColorRamp(colorRamp: ColorRamp?): GoalProgressComplicationData.Builder

Sets an optional hint which suggests the renderer draws the complication using a ColorRamp.

setMonochromaticImage

Added in 1.2.0
fun setMonochromaticImage(monochromaticImage: MonochromaticImage?): GoalProgressComplicationData.Builder

Sets optional icon associated with the complication data.

setSmallImage

Added in 1.2.0
fun setSmallImage(smallImage: SmallImage?): GoalProgressComplicationData.Builder

Sets optional image associated with the complication data.

setTapAction

Added in 1.2.0
fun setTapAction(tapAction: PendingIntent?): GoalProgressComplicationData.Builder

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

setText

Added in 1.2.0
fun setText(text: ComplicationText?): GoalProgressComplicationData.Builder

Sets optional text associated with the complication data.

setTitle

Added in 1.2.0
fun setTitle(title: ComplicationText?): GoalProgressComplicationData.Builder

Sets optional title associated with the complication data.

setValidTimeRange

Added in 1.2.0
fun setValidTimeRange(validTimeRange: TimeRange?): GoalProgressComplicationData.Builder

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