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

final @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

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

Public constructors

Builder

public final 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

Localized description for use by screen readers

Public methods

build

@NonNull
public final LongTextComplicationData build()

Builds the LongTextComplicationData.

setMonochromaticImage

@NonNull
public final LongTextComplicationData.Builder setMonochromaticImage(@Nullable MonochromaticImage icon)

Sets optional image associated with the complication data.

setSmallImage

@NonNull
public final LongTextComplicationData.Builder setSmallImage(@Nullable SmallImage smallImage)

Sets optional image associated with the complication data.

setTapAction

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

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

setTitle

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

Sets optional title associated with the complication data.

setValidTimeRange

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

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