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(
    @NonNull ComplicationText text,
    @NonNull 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

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

Public constructors

Builder

public final Builder(
    @NonNull ComplicationText text,
    @NonNull ComplicationText contentDescription
)

Public methods

setMonochromaticImage

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

Sets optional icon associated with the complication data.

setTapAction

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

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

setTitle

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

Sets optional title associated with the complication data.

setValidTimeRange

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

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