CanvasComplicationDrawable

public class CanvasComplicationDrawable implements CanvasComplication


A complication rendered with ComplicationDrawable which renders complicationSlots in a material design style. This renderer can't be shared by multiple complicationSlots.

Summary

Public fields

final @NonNull ComplicationDrawable

The ComplicationDrawable to render with.

Public constructors

CanvasComplicationDrawable(
    ComplicationDrawable drawable,
    WatchState watchState,
    CanvasComplication.InvalidateCallback invalidateCallback
)

Public methods

void
drawHighlight(
    Canvas canvas,
    Rect bounds,
    int boundsType,
    ZonedDateTime zonedDateTime,
    @ColorInt int color
)

Draws a highlight for a ComplicationSlotBoundsType.ROUND_RECT complication.

@NonNull ComplicationData

Returns the ComplicationData to render with.

@CallSuper void
loadData(
    ComplicationData complicationData,
    boolean loadDrawablesAsynchronous
)

Updates the ComplicationData used for rendering and loads any Drawables within the complicationData.

void
render(
    Canvas canvas,
    Rect bounds,
    ZonedDateTime zonedDateTime,
    RenderParameters renderParameters,
    int slotId
)

Draws the complication defined by getData into the canvas with the specified bounds.

Inherited methods

From class CanvasComplication
@WorkerThread void

Called once on a background thread before any subsequent UI thread rendering to inform the CanvasComplication of the Renderer which is useful if they need to share state.

Public fields

drawable

public final @NonNull ComplicationDrawable drawable

The ComplicationDrawable to render with.

Public constructors