-
public interface TileLayoutRenderer<T extends Object, R extends Object>A base class for a synchronous tile and resource render phase.
It assumes all async suspending work is done by the TileService, and given a single representation of the state, creates a 100% reproducible tile and resources.
This is designed to allow precise fast Android Studio previews as well as screenshot tests.
-
-
Method Summary
Modifier and Type Method Description abstract TileBuilders.TilerenderTimeline(T state, RequestBuilders.TileRequest requestParams)Produce a Timeline for the given tile request and the given state. abstract ResourceBuilders.ResourcesproduceRequestedResources(R resourceState, RequestBuilders.ResourcesRequest requestParams)Produce resources for the given request. -
-
Method Detail
-
renderTimeline
abstract TileBuilders.Tile renderTimeline(T state, RequestBuilders.TileRequest requestParams)
Produce a Timeline for the given tile request and the given state.
The state may either represent a single tile or a timeline, in which case the renderer is responsible for determining how many tiles in the timeline.
- Parameters:
requestParams- the incoming request params.
-
produceRequestedResources
abstract ResourceBuilders.Resources produceRequestedResources(R resourceState, RequestBuilders.ResourcesRequest requestParams)
Produce resources for the given request. The implementation should read androidx.wear.tiles.RequestBuilders.ResourcesRequest.getResourceIds and if not empty only return the requested resources.
- Parameters:
resourceState- the state of the resources, typically a data class containing loaded bitmaps.requestParams- the incoming request params.
-
-
-
-