ResourceBuilders.Resources.Builder

public static final class ResourceBuilders.Resources.Builder
extends Object

java.lang.Object
   ↳ androidx.wear.tiles.builders.ResourceBuilders.Resources.Builder


Builder for ResourceBuilders.Resources

Summary

Public methods

ResourceBuilders.Resources.Builder addIdToImageMapping(String id, ResourceBuilders.ImageResource.Builder imageBuilder)

Adds an entry into a map of resource_ids to images, which can be used by layouts.

ResourceBuilders.Resources.Builder addIdToImageMapping(String id, ResourceBuilders.ImageResource image)

Adds an entry into a map of resource_ids to images, which can be used by layouts.

ResourceBuilders.Resources build()

Builds an instance from accumulated values.

ResourceBuilders.Resources.Builder setVersion(String version)

Sets the version of this ResourceBuilders.Resources instance.

Inherited methods

Public methods

addIdToImageMapping

public ResourceBuilders.Resources.Builder addIdToImageMapping (String id, 
                ResourceBuilders.ImageResource.Builder imageBuilder)

Adds an entry into a map of resource_ids to images, which can be used by layouts.

Parameters
id String

imageBuilder ResourceBuilders.ImageResource.Builder

Returns
ResourceBuilders.Resources.Builder

addIdToImageMapping

public ResourceBuilders.Resources.Builder addIdToImageMapping (String id, 
                ResourceBuilders.ImageResource image)

Adds an entry into a map of resource_ids to images, which can be used by layouts.

Parameters
id String

image ResourceBuilders.ImageResource

Returns
ResourceBuilders.Resources.Builder

build

public ResourceBuilders.Resources build ()

Builds an instance from accumulated values.

Returns
ResourceBuilders.Resources

setVersion

public ResourceBuilders.Resources.Builder setVersion (String version)

Sets the version of this ResourceBuilders.Resources instance.

Each tile specifies the version of resources it requires. After fetching a tile, the renderer will use the resources version specified by the tile to separately fetch the resources.

This value must match the version of the resources required by the tile for the tile to render successfully.

Parameters
version String

Returns
ResourceBuilders.Resources.Builder