ComplicationDataTimeline

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 fields

final @NonNull ComplicationData

The default ComplicationData to be displayed

final @NonNull Collection<@NonNull TimelineEntry>

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

Public constructors

ComplicationDataTimeline(
    ComplicationData defaultComplicationData,
    Collection<TimelineEntry> timelineEntries
)

Public methods

boolean
equals(Object other)
int
@NonNull String

Public fields

defaultComplicationData

public final @NonNull ComplicationData defaultComplicationData

The default ComplicationData to be displayed

timelineEntries

public final @NonNull Collection<@NonNull TimelineEntrytimelineEntries

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

Public constructors

ComplicationDataTimeline

public final ComplicationDataTimeline(
    ComplicationData defaultComplicationData,
    Collection<TimelineEntry> timelineEntries
)
Parameters
ComplicationData defaultComplicationData

The default ComplicationData to be displayed

Collection<TimelineEntry> timelineEntries

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

Public methods

equals

public boolean equals(Object other)

hashCode

public int hashCode()

toString

public @NonNull String toString()