ShortTextComplicationData.Builder

public final class ShortTextComplicationData.Builder


Builder for ShortTextComplicationData.

You must at a minimum set the text and contentDescription fields.

Summary

Public constructors

Builder(ComplicationText text, ComplicationText contentDescription)

Public methods

final @NonNull ShortTextComplicationData

Builds the ShortTextComplicationData.

final @NonNull ShortTextComplicationData.Builder

Sets optional icon associated with the complication data.

final @NonNull ShortTextComplicationData.Builder

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

final @NonNull ShortTextComplicationData.Builder

Sets optional title associated with the complication data.

final @NonNull ShortTextComplicationData.Builder
setValidTimeRange(TimeRange validTimeRange)

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

Public constructors

Builder

public final Builder(ComplicationText text, ComplicationText contentDescription)
Parameters
ComplicationText text

The main localized ComplicationText. This must be less than 7 characters long

ComplicationText contentDescription

Localized description for use by screen readers

Public methods

build

public final @NonNull ShortTextComplicationData build()

Builds the ShortTextComplicationData.

setMonochromaticImage

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

Sets optional icon associated with the complication data.

setTapAction

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

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

setTitle

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

Sets optional title associated with the complication data.

setValidTimeRange

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

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