TileBuilders.Tile

public static final class TileBuilders.Tile
extends Object

java.lang.Object
   ↳ androidx.wear.tiles.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 classes

class TileBuilders.Tile.Builder

Builder for TileBuilders.Tile  

Public methods

static TileBuilders.Tile.Builder builder()

Returns a new TileBuilders.Tile.Builder.

long getFreshnessIntervalMillis()

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

String getResourcesVersion()

Gets the resource version required for these tiles.

TimelineBuilders.Timeline getTimeline()

Gets the tiles to show in the carousel, along with their validity periods.

Inherited methods

Public methods

builder

public static TileBuilders.Tile.Builder builder ()

Returns a new TileBuilders.Tile.Builder.

Returns
TileBuilders.Tile.Builder

getFreshnessIntervalMillis

public long getFreshnessIntervalMillis ()

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 TileProviderService#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. Intended for testing purposes only.

Returns
long

getResourcesVersion

public String getResourcesVersion ()

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 RequestBuilders.ResourcesRequest if the system does not have a copy of the specified resource version. Intended for testing purposes only.

Returns
String

getTimeline

public TimelineBuilders.Timeline getTimeline ()

Gets the tiles to show in the carousel, along with their validity periods. Intended for testing purposes only.

Returns
TimelineBuilders.Timeline