# CanvasComplicationFactory

Artifact: [androidx.wear.watchface:watchface](https://developer.android.com/jetpack/androidx/releases/wear-watchface) [View Source](https://cs.android.com/search?q=file:androidx/wear/watchface/CanvasComplicationFactory.java+class:androidx.wear.watchface.CanvasComplicationFactory) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

*** ** * ** ***


```
interface CanvasComplicationFactory
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This interface is deprecated.**   
>
> use Watch Face Format instead

Factory for creating a CanvasComplication. This decouples construction of Complications and their CanvasComplication renderers.

## Summary

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/watchface/CanvasComplication` | `@https://developer.android.com/reference/kotlin/androidx/annotation/WorkerThread [create](https://developer.android.com/reference/kotlin/androidx/wear/watchface/CanvasComplicationFactory#create(androidx.wear.watchface.WatchState,androidx.wear.watchface.CanvasComplication.InvalidateCallback))( watchState: https://developer.android.com/reference/kotlin/androidx/wear/watchface/WatchState, invalidateCallback: https://developer.android.com/reference/kotlin/androidx/wear/watchface/CanvasComplication.InvalidateCallback )` **This function is deprecated.** Deprecated in Java |

## Public functions

### create

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
@WorkerThread
fun [create](https://developer.android.com/reference/kotlin/androidx/wear/watchface/CanvasComplicationFactory#create(androidx.wear.watchface.WatchState,androidx.wear.watchface.CanvasComplication.InvalidateCallback))(
    watchState: WatchState,
    invalidateCallback: CanvasComplication.InvalidateCallback
): CanvasComplication
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

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: https://developer.android.com/reference/kotlin/androidx/wear/watchface/WatchState` | The current WatchState |
| `invalidateCallback: https://developer.android.com/reference/kotlin/androidx/wear/watchface/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 |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/watchface/CanvasComplication` | The constructed CanvasComplication. |