# TimelineBuilders.Timeline

Artifact: [androidx.wear.tiles:tiles](https://developer.android.com/jetpack/androidx/releases/wear-tiles) [View Source](https://cs.android.com/search?q=file:androidx/wear/tiles/TimelineBuilders.java+class:androidx.wear.tiles.TimelineBuilders.Timeline) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.0.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

*** ** * ** ***


```
class TimelineBuilders.Timeline
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
> Deprecated in Java

A collection of `https://developer.android.com/reference/kotlin/androidx/wear/tiles/TimelineBuilders.TimelineEntry` items.

`https://developer.android.com/reference/kotlin/androidx/wear/tiles/TimelineBuilders.TimelineEntry` items can be used to update a layout on-screen at known times, without having to explicitly update a layout. This allows for cases where, say, a calendar can be used to show the next event, and automatically switch to showing the next event when one has passed.

The active `https://developer.android.com/reference/kotlin/androidx/wear/tiles/TimelineBuilders.TimelineEntry` is switched, at most, once a minute. In the case where the validity periods of `https://developer.android.com/reference/kotlin/androidx/wear/tiles/TimelineBuilders.TimelineEntry` items overlap, the item with the shortest\* validity period will be shown. This allows a layout provider to show a "default" layout, and override it at set points without having to explicitly insert the default layout between the "override" layout.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/wear/tiles/TimelineBuilders.Timeline.Builder` **This class is deprecated.** Deprecated in Java |

| ### Public functions |
|---|---|
| `java-static https://developer.android.com/reference/kotlin/androidx/wear/tiles/TimelineBuilders.Timeline` | `[fromLayoutElement](https://developer.android.com/reference/kotlin/androidx/wear/tiles/TimelineBuilders.Timeline#fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement))(layoutElement: https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.LayoutElement)` **This function is deprecated.** Deprecated in Java |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/wear/tiles/TimelineBuilders.TimelineEntry!>` | `[getTimelineEntries](https://developer.android.com/reference/kotlin/androidx/wear/tiles/TimelineBuilders.Timeline#getTimelineEntries())()` **This function is deprecated.** Deprecated in Java |

## Public functions

### fromLayoutElement

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

```
java-static fun [fromLayoutElement](https://developer.android.com/reference/kotlin/androidx/wear/tiles/TimelineBuilders.Timeline#fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement))(layoutElement: LayoutElementBuilders.LayoutElement): TimelineBuilders.Timeline
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Returns the `https://developer.android.com/reference/kotlin/androidx/wear/tiles/TimelineBuilders.Timeline` object containing the given layout element.

### getTimelineEntries

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.0.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

```
fun [getTimelineEntries](https://developer.android.com/reference/kotlin/androidx/wear/tiles/TimelineBuilders.Timeline#getTimelineEntries())(): (Mutable)List<TimelineBuilders.TimelineEntry!>
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Gets the entries in a timeline. Intended for testing purposes only.