LongTextComplicationData.Builder


public final class LongTextComplicationData.Builder


Builder for LongTextComplicationData.

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

Summary

Public constructors

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

Public methods

@NonNull LongTextComplicationData

Builds the LongTextComplicationData.

final @NonNull LongTextComplicationData.Builder

Sets optional image associated with the complication data.

final @NonNull LongTextComplicationData.Builder

Sets optional image associated with the complication data.

final @NonNull LongTextComplicationData.Builder

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

final @NonNull LongTextComplicationData.Builder

Sets optional title associated with the complication data.

final @NonNull LongTextComplicationData.Builder
setValidTimeRange(TimeRange validTimeRange)

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

Public constructors

Builder

Added in 1.0.0
public Builder(
    @NonNull ComplicationText text,
    @NonNull ComplicationText contentDescription
)
Parameters
@NonNull ComplicationText text

Localized main ComplicationText to display within the complication. There isn't an explicit character limit but text may be truncated if too long

@NonNull ComplicationText contentDescription

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 methods

build

Added in 1.0.0
public @NonNull LongTextComplicationData build()

Builds the LongTextComplicationData.

setMonochromaticImage

Added in 1.0.0
public final @NonNull LongTextComplicationData.Builder setMonochromaticImage(MonochromaticImage icon)

Sets optional image associated with the complication data.

setSmallImage

Added in 1.0.0
public final @NonNull LongTextComplicationData.Builder setSmallImage(SmallImage smallImage)

Sets optional image associated with the complication data.

setTapAction

Added in 1.0.0
public final @NonNull LongTextComplicationData.Builder setTapAction(PendingIntent tapAction)

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

setTitle

Added in 1.0.0
public final @NonNull LongTextComplicationData.Builder setTitle(ComplicationText title)

Sets optional title associated with the complication data.

setValidTimeRange

Added in 1.0.0
public final @NonNull LongTextComplicationData.Builder setValidTimeRange(TimeRange validTimeRange)

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