Stay organized with collections Save and categorize content based on your preferences.

ListComplicationData.Builder

public final class ListComplicationData.Builder


Builder for ListComplicationData.

You must at a minimum set the complicationList, styleHint and contentDescription fields.

Summary

Public constructors

Builder(
    @NonNull List<@NonNull ComplicationData> complicationList,
    @NonNull ListComplicationData.StyleHint styleHint,
    @NonNull ComplicationText contentDescription
)

Public methods

final @NonNull ListComplicationData

Builds the ListComplicationData.

final @NonNull ListComplicationData.Builder

Sets the ComponentName of the ComplicationDataSourceService that provided this ComplicationData, if any.

final @NonNull ListComplicationData.Builder

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

final @NonNull ListComplicationData.Builder
setValidTimeRange(TimeRange validTimeRange)

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

Public constructors

Builder

public Builder(
    @NonNull List<@NonNull ComplicationData> complicationList,
    @NonNull ListComplicationData.StyleHint styleHint,
    @NonNull ComplicationText contentDescription
)
Parameters
@NonNull List<@NonNull ComplicationData> complicationList

The list ComplicationData to be displayed, typically as a table. Note complicationList may not include a ListComplicationData.

@NonNull ListComplicationData.StyleHint styleHint

The StyleHint which influences layout.

@NonNull ComplicationText contentDescription

Localized description for use by screen readers

Public methods

build

public final @NonNull ListComplicationData build()

Builds the ListComplicationData.

setDataSource

public final @NonNull ListComplicationData.Builder setDataSource(ComponentName dataSource)

Sets the ComponentName of the ComplicationDataSourceService that provided this ComplicationData, if any.

Note a ComplicationDataSourceService does not need to call this because the system will set this value on its behalf.

setTapAction

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

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

setValidTimeRange

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

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