TileBuilders.Tile


@RequiresSchemaVersion(major = 1, minor = 0)
class TileBuilders.Tile


A holder for a tile. This specifies the resources to use for this delivery of the tile, and the timeline for the tile.

Summary

Nested types

Builder for Tile

Public functions

Long

Gets how many milliseconds of elapsed time (**not** wall clock time) this tile can be considered to be "fresh".

String

Gets the resource version required for these tiles.

StateBuilders.State?

Gets androidx.wear.protolayout.StateBuilders.State for this tile.

TimelineBuilders.Timeline?

Gets the androidx.wear.protolayout.TimelineBuilders.Timeline containing the layouts for the tiles to show in the carousel, along with their validity periods.

TimelineBuilders.Timeline?

This function is deprecated.

Use getTileTimeline instead.

String

Public functions

getFreshnessIntervalMillis

Added in 1.0.0
fun getFreshnessIntervalMillis(): Long

Gets how many milliseconds of elapsed time (**not** wall clock time) this tile can be considered to be "fresh". The platform will attempt to refresh your tile at some point in the future after this interval has lapsed. A value of 0 here signifies that auto-refreshes should not be used (i.e. you will manually request updates via TileService#getRequester).

This mechanism should not be used to update your tile more frequently than once a minute, and the system may throttle your updates if you request updates faster than this interval. This interval is also inexact; the system will generally update your tile if it is on-screen, or about to be on-screen, although this is not guaranteed due to system-level optimizations.

getResourcesVersion

Added in 1.0.0
fun getResourcesVersion(): String

Gets the resource version required for these tiles. This can be any developer-defined string; it is only used to cache resources, and is passed in if the system does not have a copy of the specified resource version.

getState

Added in 1.2.0
fun getState(): StateBuilders.State?

Gets androidx.wear.protolayout.StateBuilders.State for this tile.

getTileTimeline

Added in 1.2.0
fun getTileTimeline(): TimelineBuilders.Timeline?

Gets the androidx.wear.protolayout.TimelineBuilders.Timeline containing the layouts for the tiles to show in the carousel, along with their validity periods.

getTimeline

Added in 1.0.0
Deprecated in 1.2.0
fun getTimeline(): TimelineBuilders.Timeline?

Gets the androidx.wear.tiles.TimelineBuilders.Timeline containing the layouts for the tiles to show in the carousel, along with their validity periods.

toString

fun toString(): String