public final class ComplicationDataTimeline


A collection of TimelineEntry items.

This allows a sequence of ComplicationData to be delivered to the watch face which can be cached and updated automatically. E.g. today's weather forecast at various times or multiple upcoming calendar events.

In the case where the validity periods of TimelineEntry items overlap, the item with the shortest validity period will be shown. If none are valid then the defaultComplicationData will be shown. This allows a complication datasource to show a "default", and override it at set points without having to explicitly insert the default ComplicationData between the each "override".

The complication to render from a timeline is selected each time the watch face is rendered, however the presence of a timeline does not trigger any extra frames to be rendered. Most watch faces render at least once per minute at the top of the minute so complication updates should be timely.

Note older watch faces only support defaultComplicationData, and v1.1 of wear-watchface is required to support timelineEntries.

Summary

Public constructors

ComplicationDataTimeline(
    @NonNull ComplicationData defaultComplicationData,
    @NonNull Collection<@NonNull TimelineEntry> timelineEntries
)

Public methods

boolean
equals(Object other)
final @NonNull ComplicationData

The default ComplicationData to be displayed

final @NonNull Collection<@NonNull TimelineEntry>

A collection of "overrides" to be displayed at certain times

int
@NonNull String

Public constructors

ComplicationDataTimeline

Added in 1.1.0
public ComplicationDataTimeline(
    @NonNull ComplicationData defaultComplicationData,
    @NonNull Collection<@NonNull TimelineEntry> timelineEntries
)
Parameters
@NonNull ComplicationData defaultComplicationData

The default ComplicationData to be displayed

@NonNull Collection<@NonNull TimelineEntry> timelineEntries

A collection of "overrides" to be displayed at certain times

Public methods

equals

public boolean equals(Object other)

getDefaultComplicationData

Added in 1.1.0
public final @NonNull ComplicationData getDefaultComplicationData()

The default ComplicationData to be displayed

getTimelineEntries

Added in 1.1.0
public final @NonNull Collection<@NonNull TimelineEntrygetTimelineEntries()

A collection of "overrides" to be displayed at certain times

hashCode

public int hashCode()

toString

public @NonNull String toString()