# ComplicationDataTimeline

Artifact: [androidx.wear.watchface:watchface-complications-data-source](https://developer.android.com/jetpack/androidx/releases/wear-watchface) [View Source](https://cs.android.com/search?q=file:androidx/wear/watchface/complications/datasource/ComplicationDataTimeline.kt+class:androidx.wear.watchface.complications.datasource.ComplicationDataTimeline) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.1.0)

*** ** * ** ***


```
public final class ComplicationDataTimeline
```

<br />

*** ** * ** ***

A collection of TimelineEntry items.

This allows a sequence of `https://developer.android.com/reference/androidx/wear/watchface/complications/data/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 `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataTimeline#(androidx.wear.watchface.complications.data.ComplicationData,kotlin.collections.Collection)` 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 `https://developer.android.com/reference/androidx/wear/watchface/complications/data/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 `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataTimeline#(androidx.wear.watchface.complications.data.ComplicationData,kotlin.collections.Collection)`, and v1.1 of wear-watchface is required to support `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataTimeline#(androidx.wear.watchface.complications.data.ComplicationData,kotlin.collections.Collection)`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataTimeline#ComplicationDataTimeline(androidx.wear.watchface.complications.data.ComplicationData,kotlin.collections.Collection)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/complications/data/ComplicationData defaultComplicationData, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/TimelineEntry> timelineEntries )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataTimeline#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/complications/data/ComplicationData` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataTimeline#getDefaultComplicationData()()` The default `https://developer.android.com/reference/androidx/wear/watchface/complications/data/ComplicationData` to be displayed |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/TimelineEntry>` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataTimeline#getTimelineEntries()()` A collection of "overrides" to be displayed at certain times |
| `int` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataTimeline#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataTimeline#toString()()` |

## Public constructors

### ComplicationDataTimeline

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.1.0)

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

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/complications/data/ComplicationData defaultComplicationData` | The default `https://developer.android.com/reference/androidx/wear/watchface/complications/data/ComplicationData` to be displayed |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/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](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.1.0)

```
public final @NonNull ComplicationData getDefaultComplicationData()
```

The default `https://developer.android.com/reference/androidx/wear/watchface/complications/data/ComplicationData` to be displayed

### getTimelineEntries

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.1.0)

```
public final @NonNull Collection<@NonNull TimelineEntry> getTimelineEntries()
```

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

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```