# InProgressShape

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/InProgressShape.kt+class:androidx.ink.authoring.InProgressShape) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/ink#1.0.0)

*** ** * ** ***


```
@ExperimentalInkCustomShapeWorkflowApi
public interface InProgressShape<ShapeSpecT extends Object, CompletedShapeT extends Object>
```

<br />

*** ** * ** ***

Implement this interface to efficiently build a custom shape over the course of multiple rendering frames with incremental freehand inputs.

Resembles the interface of `https://developer.android.com/reference/androidx/ink/strokes/InProgressStroke`, but can be implemented with custom functionality to achieve low latency authoring with custom geometry and rendering.

The internal state of this object should only be modified by the functions of this interface so that its rendered state stays in sync properly with its logical state. Low latency rendering avoids re-rendering the object each time, so managing this improperly could result in graphics artifacts or poor performance.

This instance will be reused for performance purposes according to the following lifecycle:

1. `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#start(kotlin.Any,kotlin.Long)` is called to set the `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape` on this object, reset any previous state, and do any required setup.

2. This shape is repeatedly updated by:

   1. Calling `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)` with any new real and predicted freehand inputs. This may happen multiple times in a row before the next call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#update(kotlin.Long)`.

   2. Calling `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#update(kotlin.Long)` to process the enqueued inputs into a calculated shape for rendering. If `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#changesWithTime()` returns `true`, then this may be called multiple times in a row before the next call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)`.

   3. Rendering the calculated shape using an `https://developer.android.com/reference/androidx/ink/authoring/InProgressShapeRenderer` compatible with this shape type.

3. `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#finishInput()` is called once there are no more inputs for this stroke (e.g. the user lifts the stylus from the screen). Alternately, `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#cancel()` may be called if the stroke is cancelled.

4. `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#update(kotlin.Long)` continues to be called and the shape is rendered until `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#getCompletedShape()` returns a non-null value, and even afterwards if `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#changesWithTime()` returns `true`.

5. `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#prepareToRecycle()` is called to optionally reset state early, allowing non-reused objects to be garbage collected promptly.

| Parameters |
|---|---|
| `<ShapeSpecT extends https://developer.android.com/reference/java/lang/Object.html>` | A type that defines how inputs will be interpreted. This is typically pure, immutable data. |
| `<CompletedShapeT extends https://developer.android.com/reference/java/lang/Object.html>` | A type that represents the completed form of this `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape`. |

## Summary

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#cancel()()` Indicates that this shape will longer be drawn. |
| `abstract boolean` | `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#changesWithTime()()` Whether calls to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#update(kotlin.Long)` with new timestamp values may cause changes to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#getUpdatedRegion()`, even when there haven't been calls to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)`. |
| `abstract void` | `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/strokes/StrokeInputBatch realInputs, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/strokes/StrokeInputBatch predictedInputs )` Append the incremental `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)` and set the prediction to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)`, replacing any previous prediction. |
| `abstract void` | `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#finishInput()()` Indicate that no new calls to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)` will be made until the next call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#start(kotlin.Any,kotlin.Long)`. |
| `abstract void` | `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#forceCompletion()()` If this is called, a subsequent call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#getCompletedShape()` must return a non-null `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape`. |
| `abstract CompletedShapeT` | `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#getCompletedShape()()` Get the `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape` if this shape has been completed, or `null` otherwise. |
| `abstract https://developer.android.com/reference/androidx/ink/geometry/Box` | `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#getUpdatedRegion()()` Returns an axis-aligned bounding rectangle of parts of the shape added, removed, or changed since the most recent call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#start(kotlin.Any,kotlin.Long)` or `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#resetUpdatedRegion()`, assuming no intervening call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#prepareToRecycle()`. |
| `abstract boolean` | `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#isCanceled()()` Returns whether `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#cancel()` has been called since the most recent call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#start(kotlin.Any,kotlin.Long)`, assuming no intervening call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#prepareToRecycle()`. |
| `default void` | `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#prepareToRecycle()()` The optional inverse of `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#start(kotlin.Any,kotlin.Long)`, where some state can be cleaned up when this instance is not currently needed but may be used again in the future. |
| `abstract void` | `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#resetUpdatedRegion()()` Reset the bounding box returned by `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#getUpdatedRegion()` to `null` until the next call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#update(kotlin.Long)` or `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#cancel()`. |
| `abstract void` | `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#start(kotlin.Any,kotlin.Long)(@https://developer.android.com/reference/androidx/annotation/NonNull ShapeSpecT shapeSpec, long systemElapsedTimeMillis)` Prepare for this instance to be used for shape creation, by receiving inputs through `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)`, applying those inputs during `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#update(kotlin.Long)`, and being rendered according to `https://developer.android.com/reference/androidx/ink/authoring/ShapeWorkflow#inProgressShapeRenderer()`. |
| `abstract void` | `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#update(kotlin.Long)(long shapeDurationMillis)` Update internal state of this shape based on the provided timestamps as well as any inputs passed to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)` since the last call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#update(kotlin.Long)`. |

## Public methods

### cancel

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

```
abstract void cancel()
```

Indicates that this shape will longer be drawn. It will not receive any further calls to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)` or `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#update(kotlin.Long)`, and it will never receive a call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#finishInput()`.

After `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#cancel()`, the region returned by `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#getUpdatedRegion()` must include the entire shape's latest bounding box, plus any region removed before cancellation but after the last call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#resetUpdatedRegion()`. This is because everything that was removed since the last call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#resetUpdatedRegion()` must be erased now that the shape is cancelled. After a subsequent call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#resetUpdatedRegion()`, further calls to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#getUpdatedRegion()` must return `null` until the next call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#prepareToRecycle()`.

`https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#isCanceled()` must return `true` from when `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#cancel()` is called until the next call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#prepareToRecycle()`.

### changesWithTime

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

```
abstract boolean changesWithTime()
```

Whether calls to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#update(kotlin.Long)` with new timestamp values may cause changes to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#getUpdatedRegion()`, even when there haven't been calls to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)`.

### enqueueInputs

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

```
abstract void enqueueInputs(
    @NonNull StrokeInputBatch realInputs,
    @NonNull StrokeInputBatch predictedInputs
)
```

Append the incremental `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)` and set the prediction to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)`, replacing any previous prediction. Queued inputs must not be processed right away - they can only be processed on the next call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#update(kotlin.Long)`.

Implementations of this function can assume that:

- `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#start(kotlin.Any,kotlin.Long)` has been called to set the current `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape` on this instance.

- `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#finishInput()` has not been called since then, and neither has `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#prepareToRecycle()`.

- `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)` and `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)` form a valid stroke input sequence together with previously added real input. In particular, this means that the first input in `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)` must be valid following the last input in previously added real inputs, and the first input in `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)` must be valid following the last input in `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)`: They have the same `https://developer.android.com/reference/androidx/ink/brush/InputToolType`, their `https://developer.android.com/reference/androidx/ink/strokes/StrokeInput#elapsedTimeMillis()` values are monotonically non-decreasing, and they do not duplicate the previous input.

Either one or both of `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)` and `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)` may be empty.

The `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)` and `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)` instances will be recycled and cannot be retained - implementations must copy the necessary data from them before this function returns.

### finishInput

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

```
abstract void finishInput()
```

Indicate that no new calls to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)` will be made until the next call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#start(kotlin.Any,kotlin.Long)`.

This occurs after the final call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)` and before any corresponding call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#update(kotlin.Long)`.

### forceCompletion

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

```
abstract void forceCompletion()
```

If this is called, a subsequent call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#getCompletedShape()` must return a non-null `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape`. This can only be called after `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#finishInput()` and `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#update(kotlin.Long)`, before a subsequent call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#prepareToRecycle()`.

### getCompletedShape

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

```
abstract CompletedShapeT getCompletedShape()
```

Get the `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape` if this shape has been completed, or `null` otherwise. This can only be called after:

1. The final call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)`.

2. The call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#finishInput()` to indicate that the previous call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)` was the final one.

3. A call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#update(kotlin.Long)`.

In most circumstances, this will return a non-null value the first time it is called. But some shapes involve time-based effects after all inputs have been received, which may cause this to return `null` for a little while longer, in which time more calls to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#update(kotlin.Long)` will occur.

If those effects are finite and prevent the shape from being considered completed, then this function may return `null` until the time passed to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#update(kotlin.Long)` progresses enough. Some examples of this include a shape "settling", e.g. to simulate motion coming to rest or the physical process of ink absorbing or "bleeding" into paper.

This must not return a non-null value until the `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape` instance returned by this function will no longer change. Once it returns a non-null value, `https://developer.android.com/reference/androidx/ink/authoring/InProgressShapesView` will not call this function again until this instance is reused for a new shape. Note that may still be before all calls to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#update(kotlin.Long)` are completed. For example, if `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#changesWithTime()` returns `true`, there may be more calls to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#update(kotlin.Long)` to increment an animation progress value which is expected to be continued after the shape has been handed off via `https://developer.android.com/reference/androidx/ink/authoring/InProgressShapesCompletedListener`.

This function should not modify, reset, or clear any internal state, even once it begins returning a non-null value, as the `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape` is still used for rendering until `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#prepareToRecycle()` is called. It may return `null` again after a call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#prepareToRecycle()`, and must after a subsequent call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#start(kotlin.Any,kotlin.Long)`.

### getUpdatedRegion

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

```
abstract Box getUpdatedRegion()
```

Returns an axis-aligned bounding rectangle of parts of the shape added, removed, or changed since the most recent call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#start(kotlin.Any,kotlin.Long)` or `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#resetUpdatedRegion()`, assuming no intervening call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#prepareToRecycle()`. This result may change due to calls to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#update(kotlin.Long)` or `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#cancel()` (cancel changes the drawn shape by removing everything that was drawn previously). The resulting `https://developer.android.com/reference/androidx/ink/geometry/Box` must be in the same coordinate system as the inputs supplied to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)`. If no changes have occurred, this must return `null`.

### isCanceled

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

```
abstract boolean isCanceled()
```

Returns whether `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#cancel()` has been called since the most recent call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#start(kotlin.Any,kotlin.Long)`, assuming no intervening call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#prepareToRecycle()`.

### prepareToRecycle

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

```
default void prepareToRecycle()
```

The optional inverse of `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#start(kotlin.Any,kotlin.Long)`, where some state can be cleaned up when this instance is not currently needed but may be used again in the future. Do not actually release underlying resources that would have to be reallocated on another future call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#start(kotlin.Any,kotlin.Long)`, as performing that allocation each time can hurt performance. The behavior of reading this object between this and the next call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#start(kotlin.Any,kotlin.Long)` is not defined by this interface. Relevant state may be cleared here, and must be reset either here or in the next call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#start(kotlin.Any,kotlin.Long)`.

### resetUpdatedRegion

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

```
abstract void resetUpdatedRegion()
```

Reset the bounding box returned by `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#getUpdatedRegion()` to `null` until the next call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#update(kotlin.Long)` or `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#cancel()`.

### start

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

```
abstract void start(@NonNull ShapeSpecT shapeSpec, long systemElapsedTimeMillis)
```

Prepare for this instance to be used for shape creation, by receiving inputs through `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)`, applying those inputs during `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#update(kotlin.Long)`, and being rendered according to `https://developer.android.com/reference/androidx/ink/authoring/ShapeWorkflow#inProgressShapeRenderer()`. The shape specified by these parameters will be valid until `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#prepareToRecycle()` is called.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull ShapeSpecT shapeSpec` | The `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape` to apply as stylus configuration to the upcoming inputs. |
| `long systemElapsedTimeMillis` | The system time in the `https://developer.android.com/reference/android/os/SystemClock.html` time base corresponding to a timestamp of 0 in `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)` and `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#update(kotlin.Long)`. It is monotonically non-decreasing. Most implementations shouldn't use this and should instead rely on the relative timestamps in `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)` and `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#update(kotlin.Long)`, but this value can be added to those if a more "absolute" timestamp is needed, e.g. when aligning with animations in the rest of an application, similar to how `https://developer.android.com/reference/android/view/Choreographer.FrameCallback.html` timestamps are used. |

### update

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

```
abstract void update(long shapeDurationMillis)
```

Update internal state of this shape based on the provided timestamps as well as any inputs passed to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)` since the last call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#update(kotlin.Long)`. Will be called exactly once for each call to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShapeRenderer#draw(android.graphics.Canvas,androidx.ink.authoring.InProgressShape,android.graphics.Matrix)`.

| Parameters |
|---|---|
| `long shapeDurationMillis` | The current timestamp that is directly comparable to those in the `https://developer.android.com/reference/androidx/ink/strokes/StrokeInputBatch` objects provided to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#enqueueInputs(androidx.ink.strokes.StrokeInputBatch,androidx.ink.strokes.StrokeInputBatch)`, which is the time since the first input event for this stroke. This timestamp is monotonically non-decreasing. It is derived from a value that is aligned with frame timestamps, similar to `https://developer.android.com/reference/android/view/Choreographer.FrameCallback.html#doFrame(long)`, so that time-based effects on shapes are updated in sync with animations throughout the entire system. This relative timestamp is suitable (and preferred) for most calculations, but if the more absolute system timestamp is needed for animation synchronization, add this value to the timestamp passed to `https://developer.android.com/reference/androidx/ink/authoring/InProgressShape#start(kotlin.Any,kotlin.Long)` to get the "current" system frame time. |