CompletedShapeRenderer


@ExperimentalInkCustomShapeWorkflowApi
public interface CompletedShapeRenderer<CompletedShapeT extends Object>


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

Summary

Public methods

default boolean
@UiThread
changesWithTime(@NonNull CompletedShapeT shape)

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

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

Draw an instance of CompletedShapeT to a Canvas.

Public methods

changesWithTime

Added in 1.0.0
@UiThread
default boolean changesWithTime(@NonNull CompletedShapeT shape)

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
abstract void draw(
    @NonNull Canvas canvas,
    @NonNull CompletedShapeT shape,
    @NonNull Matrix strokeToScreenTransform,
    long animatorClockStateMillis
)

Draw an instance of CompletedShapeT to a Canvas.

Parameters
@NonNull Canvas canvas

The output Canvas to draw to.

@NonNull CompletedShapeT shape

The object to be drawn.

@NonNull Matrix strokeToScreenTransform

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.

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.