CompletedShapeRenderer


@ExperimentalInkCustomShapeWorkflowApi
interface CompletedShapeRenderer<CompletedShapeT : Any>


Called to render a CompletedShapeT instance to an android.graphics.Canvas.

Summary

Public functions

open Boolean
@UiThread
changesWithTime(shape: CompletedShapeT)

Whether calls to draw with a new timestamp value results in different visual output.

Unit
@UiThread
draw(
    canvas: Canvas,
    shape: CompletedShapeT,
    strokeToScreenTransform: Matrix,
    animatorClockStateMillis: Long
)

Draw an instance of CompletedShapeT to a Canvas.

Public functions

changesWithTime

Added in 1.0.0
@UiThread
open fun changesWithTime(shape: CompletedShapeT): Boolean

Whether calls to draw with a new timestamp value results in different visual output. In other words, return true if and only if shape is animated.

draw

Added in 1.0.0
@UiThread
fun draw(
    canvas: Canvas,
    shape: CompletedShapeT,
    strokeToScreenTransform: Matrix,
    animatorClockStateMillis: Long
): Unit

Draw an instance of CompletedShapeT to a Canvas.

Parameters
canvas: Canvas

The output Canvas to draw to.

shape: CompletedShapeT

The object to be drawn.

strokeToScreenTransform: Matrix

The full transform that has already been applied to the Canvas 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.

animatorClockStateMillis: Long

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.