TileRenderer

public final class TileRenderer
extends Object

java.lang.Object
   ↳ androidx.wear.tiles.renderer.TileRenderer


Renderer for Wear Tiles.

This variant uses Android views to represent the contents of the Wear Tile.

Summary

Nested classes

interface TileRenderer.LoadActionListener

Listener for clicks on Clickable objects that have an Action to (re)load the contents of a tile. 

Public constructors

TileRenderer(Context appContext, LayoutElementBuilders.Layout layout, ResourceBuilders.Resources resources, Executor loadActionExecutor, TileRenderer.LoadActionListener loadActionListener)

Default constructor.

TileRenderer(Context appContext, LayoutElementBuilders.Layout layout, int tilesTheme, ResourceBuilders.Resources resources, Executor loadActionExecutor, TileRenderer.LoadActionListener loadActionListener)

Default constructor.

Public methods

View inflate(ViewGroup parent)

Inflates a Tile into parent.

Inherited methods

Public constructors

TileRenderer

public TileRenderer (Context appContext, 
                LayoutElementBuilders.Layout layout, 
                ResourceBuilders.Resources resources, 
                Executor loadActionExecutor, 
                TileRenderer.LoadActionListener loadActionListener)

Default constructor.

Parameters
appContext Context: The application context.

layout LayoutElementBuilders.Layout: The portion of the Tile to render.

resources ResourceBuilders.Resources: The resources for the Tile.

loadActionExecutor Executor

loadActionListener TileRenderer.LoadActionListener: Listener for clicks that will cause the contents to be reloaded.

TileRenderer

public TileRenderer (Context appContext, 
                LayoutElementBuilders.Layout layout, 
                int tilesTheme, 
                ResourceBuilders.Resources resources, 
                Executor loadActionExecutor, 
                TileRenderer.LoadActionListener loadActionListener)

Default constructor.

Parameters
appContext Context: The application context.

layout LayoutElementBuilders.Layout: The portion of the Tile to render.

tilesTheme int: The theme to use for this Tile instance. This can be used to customise things like the default font family. Pass 0 to use the default theme.

resources ResourceBuilders.Resources: The resources for the Tile.

loadActionExecutor Executor

loadActionListener TileRenderer.LoadActionListener: Listener for clicks that will cause the contents to be reloaded.

Public methods

inflate

public View inflate (ViewGroup parent)

Inflates a Tile into parent.

Parameters
parent ViewGroup: The view to attach the tile into.

Returns
View The first child that was inflated. This may be null if the proto is empty the top-level LayoutElement has no inner set, or the top-level LayoutElement contains an unsupported inner type.