# CompletedShapeRenderer

Artifact: [androidx.ink:ink-authoring](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/authoring/CompletedShapeRenderer.kt+class:androidx.ink.authoring.CompletedShapeRenderer) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/ink#1.0.0)

*** ** * ** ***


```
@ExperimentalInkCustomShapeWorkflowApi
public interface CompletedShapeRenderer<CompletedShapeT extends Object>
```

<br />

*** ** * ** ***

Called to render a `https://developer.android.com/reference/androidx/ink/authoring/CompletedShapeRenderer` instance to an `https://developer.android.com/reference/android/graphics/Canvas.html`.

## Summary

| ### Public methods |
|---|---|
| `default boolean` | `@https://developer.android.com/reference/androidx/annotation/UiThread https://developer.android.com/reference/androidx/ink/authoring/CompletedShapeRenderer#changesWithTime(kotlin.Any)(@https://developer.android.com/reference/androidx/annotation/NonNull CompletedShapeT shape)` Whether calls to `https://developer.android.com/reference/androidx/ink/authoring/CompletedShapeRenderer#draw(android.graphics.Canvas,kotlin.Any,android.graphics.Matrix,kotlin.Long)` with a new timestamp value results in different visual output. |
| `abstract void` | `@https://developer.android.com/reference/androidx/annotation/UiThread https://developer.android.com/reference/androidx/ink/authoring/CompletedShapeRenderer#draw(android.graphics.Canvas,kotlin.Any,android.graphics.Matrix,kotlin.Long)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Canvas.html canvas, @https://developer.android.com/reference/androidx/annotation/NonNull CompletedShapeT shape, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Matrix.html strokeToScreenTransform, long animatorClockStateMillis )` Draw an instance of `https://developer.android.com/reference/androidx/ink/authoring/CompletedShapeRenderer` to a `https://developer.android.com/reference/android/graphics/Canvas.html`. |

## Public methods

### changesWithTime

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/ink#1.0.0)

```
@UiThread
default boolean changesWithTime(@NonNull CompletedShapeT shape)
```

Whether calls to `https://developer.android.com/reference/androidx/ink/authoring/CompletedShapeRenderer#draw(android.graphics.Canvas,kotlin.Any,android.graphics.Matrix,kotlin.Long)` with a new timestamp value results in different visual output. In other words, return `true` if and only if `https://developer.android.com/reference/androidx/ink/authoring/CompletedShapeRenderer#changesWithTime(kotlin.Any)` is animated.

### draw

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/ink#1.0.0)

```
@UiThread
abstract void draw(
    @NonNull Canvas canvas,
    @NonNull CompletedShapeT shape,
    @NonNull Matrix strokeToScreenTransform,
    long animatorClockStateMillis
)
```

Draw an instance of `https://developer.android.com/reference/androidx/ink/authoring/CompletedShapeRenderer` to a `https://developer.android.com/reference/android/graphics/Canvas.html`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Canvas.html canvas` | The output `https://developer.android.com/reference/android/graphics/Canvas.html` to draw to. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull CompletedShapeT shape` | The object to be drawn. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Matrix.html strokeToScreenTransform` | The full transform that has already been applied to the `https://developer.android.com/reference/android/graphics/Canvas.html` in order to draw this object. Most implementations do not need to use this data, but it is provided for certain rare circumstances (such as analytical anti-aliasing) that require it. |
| `long animatorClockStateMillis` | The current timestamp to be used for animation calculations. Note that the animation timing may not proceed at the same rate as system elapsed time - it will by default, but may be paused and resumed, or sped up, or slowed down. |