# 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)

*** ** * ** ***


```
public 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 methods |
|---|---|
| `abstract @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/watchface/CanvasComplication` | `@https://developer.android.com/reference/androidx/annotation/WorkerThread [create](https://developer.android.com/reference/androidx/wear/watchface/CanvasComplicationFactory#create(androidx.wear.watchface.WatchState,androidx.wear.watchface.CanvasComplication.InvalidateCallback))( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/watchface/WatchState watchState, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/watchface/CanvasComplication.InvalidateCallback invalidateCallback )` **This method is deprecated.** Deprecated in Java |

## Public methods

### 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
abstract @NonNull CanvasComplication [create](https://developer.android.com/reference/androidx/wear/watchface/CanvasComplicationFactory#create(androidx.wear.watchface.WatchState,androidx.wear.watchface.CanvasComplication.InvalidateCallback))(
    @NonNull WatchState watchState,
    @NonNull CanvasComplication.InvalidateCallback invalidateCallback
)
```

> [!CAUTION]
> **This method 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 |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/watchface/WatchState watchState` | The current WatchState |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/watchface/CanvasComplication.InvalidateCallback 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://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/watchface/CanvasComplication` | The constructed CanvasComplication. |