TileBuilders.Tile.Builder


class TileBuilders.Tile.Builder


Builder for Tile

Summary

Public constructors

@RequiresSchemaVersion(major = 1, minor = 0)
Builder()

Creates an instance of Builder.

Public functions

TileBuilders.Tile

Builds an instance from accumulated values.

TileBuilders.Tile.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setFreshnessIntervalMillis(freshnessIntervalMillis: Long)

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

TileBuilders.Tile.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setResourcesVersion(resourcesVersion: String)

Sets the resource version required for these tiles.

TileBuilders.Tile.Builder
@RequiresSchemaVersion(major = 1, minor = 200)
setState(state: StateBuilders.State)

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

TileBuilders.Tile.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setTileTimeline(tileTimeline: TimelineBuilders.Timeline)

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

TileBuilders.Tile.Builder

This function is deprecated.

Use setTileTimeline instead.

Public constructors

Builder

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
Builder()

Creates an instance of Builder.

Public functions

build

Added in 1.0.0
fun build(): TileBuilders.Tile

Builds an instance from accumulated values.

setFreshnessIntervalMillis

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
fun setFreshnessIntervalMillis(freshnessIntervalMillis: Long): TileBuilders.Tile.Builder

Sets 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.

setResourcesVersion

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
fun setResourcesVersion(resourcesVersion: String): TileBuilders.Tile.Builder

Sets 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.

setState

Added in 1.2.0
@RequiresSchemaVersion(major = 1, minor = 200)
fun setState(state: StateBuilders.State): TileBuilders.Tile.Builder

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

setTileTimeline

Added in 1.2.0
@RequiresSchemaVersion(major = 1, minor = 0)
fun setTileTimeline(tileTimeline: TimelineBuilders.Timeline): TileBuilders.Tile.Builder

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

setTimeline

Added in 1.0.0
Deprecated in 1.2.0
fun setTimeline(timeline: TimelineBuilders.Timeline): TileBuilders.Tile.Builder

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