CanvasComplicationFactory
interface CanvasComplicationFactory
Factory for creating a CanvasComplication. This decouples construction of Complications and their CanvasComplication renderers.
Summary
Public functions |
|
|---|---|
CanvasComplication |
@WorkerThreadCreates a CanvasComplication. |
Public functions
create
@WorkerThread
funcreate(
watchState: WatchState,
invalidateCallback: CanvasComplication.InvalidateCallback
): CanvasComplication
Creates a CanvasComplication. This will be called on a background thread, however all CanvasComplication rendering will be done on the UI thread and there's a memory barrier between construction and usage so no special threading primitives are required. If the CanvasComplication needs to share state with the Renderer then it should override onRendererCreated.
| Parameters | |
|---|---|
watchState: WatchState |
The current WatchState |
invalidateCallback: CanvasComplication.InvalidateCallback |
The CanvasComplication.InvalidateCallback the constructed CanvasComplication can use to request redrawing. This is typically used in conjunction with asynchronous loading of Drawables to update the watch face once the drawable has loaded. |
| Returns | |
|---|---|
CanvasComplication |
The constructed CanvasComplication. |