# 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)

*** ** * ** ***


```
public final class TimelineBuilders.Timeline
```

<br />

*** ** * ** ***

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

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

`https://developer.android.com/reference/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/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/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 |
|---|
| `public final class https://developer.android.com/reference/androidx/wear/tiles/TimelineBuilders.Timeline.Builder` **This class is deprecated.** Deprecated in Java |

| ### Public methods |
|---|---|
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/TimelineBuilders.Timeline` | `[fromLayoutElement](https://developer.android.com/reference/androidx/wear/tiles/TimelineBuilders.Timeline#fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement))( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.LayoutElement layoutElement )` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/wear/tiles/TimelineBuilders.TimelineEntry>` | `[getTimelineEntries](https://developer.android.com/reference/androidx/wear/tiles/TimelineBuilders.Timeline#getTimelineEntries())()` **This method is deprecated.** Deprecated in Java |

## Public methods

### 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)

```
public static @NonNull TimelineBuilders.Timeline [fromLayoutElement](https://developer.android.com/reference/androidx/wear/tiles/TimelineBuilders.Timeline#fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement))(
    @NonNull LayoutElementBuilders.LayoutElement layoutElement
)
```

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

Returns the `https://developer.android.com/reference/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)

```
public @NonNull List<TimelineBuilders.TimelineEntry> [getTimelineEntries](https://developer.android.com/reference/androidx/wear/tiles/TimelineBuilders.Timeline#getTimelineEntries())()
```

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

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