# TilePreviewHelper

Artifact: [androidx.wear.tiles:tiles-tooling-preview](https://developer.android.com/jetpack/androidx/releases/wear-tiles) [View Source](https://cs.android.com/search?q=file:androidx/wear/tiles/tooling/preview/TilePreviewHelper.kt+class:androidx.wear.tiles.tooling.preview.TilePreviewHelper) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.3.0)

*** ** * ** ***


```
public static class TilePreviewHelper
```

<br />

*** ** * ** ***

Helper object that provides methods to create Tiles for Preview purposes.

## Summary

| ### Public fields |
|---|---|
| `static @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/tiles/tooling/preview/TilePreviewHelper` | `https://developer.android.com/reference/androidx/wear/tiles/tooling/preview/TilePreviewHelper#INSTANCE()` |

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/tiles/TileBuilders.Tile.Builder` | `https://developer.android.com/reference/androidx/wear/tiles/tooling/preview/TilePreviewHelper#singleTimelineEntryTileBuilder(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.LayoutElement layoutElement )` Helper method that creates a `https://developer.android.com/reference/androidx/wear/tiles/TileBuilders.Tile.Builder` with a timeline consisting of a single timeline entry. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/tiles/TileBuilders.Tile.Builder` | `https://developer.android.com/reference/androidx/wear/tiles/tooling/preview/TilePreviewHelper#singleTimelineEntryTileBuilder(androidx.wear.protolayout.LayoutElementBuilders.Layout)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Layout layout )` Helper method that creates a `https://developer.android.com/reference/androidx/wear/tiles/TileBuilders.Tile.Builder` with a timeline consisting of a single timeline entry. |

## Public fields

### INSTANCE

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

```
public static @NonNull TilePreviewHelper INSTANCE
```

## Public methods

### singleTimelineEntryTileBuilder

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

```
public static final @NonNull TileBuilders.Tile.Builder singleTimelineEntryTileBuilder(
    @NonNull LayoutElementBuilders.LayoutElement layoutElement
)
```

Helper method that creates a `https://developer.android.com/reference/androidx/wear/tiles/TileBuilders.Tile.Builder` with a timeline consisting of a single timeline entry. The provided `https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.LayoutElement` is wrapped in a `https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Box` and used as the timeline entry's layout.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.LayoutElement layoutElement` | The layout element that will be used to create a single entry timeline `https://developer.android.com/reference/androidx/wear/tiles/TileBuilders.Tile.Builder`. This layout element will be added to a `https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Box` which will then be used as the layout root of the `https://developer.android.com/reference/androidx/wear/tiles/TileBuilders.Tile.Builder`'s timeline entry. The layout element will be aligned in the center of the `https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Box`. |

### singleTimelineEntryTileBuilder

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

```
public static final @NonNull TileBuilders.Tile.Builder singleTimelineEntryTileBuilder(
    @NonNull LayoutElementBuilders.Layout layout
)
```

Helper method that creates a `https://developer.android.com/reference/androidx/wear/tiles/TileBuilders.Tile.Builder` with a timeline consisting of a single timeline entry. The provided `https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Layout` is used as the layout of the timeline entry.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Layout layout` | The layout that will be used to create the single timeline entry in the `https://developer.android.com/reference/androidx/wear/tiles/TileBuilders.Tile.Builder`. |