ComplicationHighlightRenderer


Note: As of July 10, 2024, watch faces must use the Watch Face Format in order to be installed on new watches that launch with Wear OS 5 pre-installed. Learn more about the user-facing changes in this Help Center article.

Additionally, starting in early 2025 (specific date to be announced during Q4 2024), all new watch faces published on Google Play must use the Watch Face Format.

public final class ComplicationHighlightRenderer


Helper for rendering a thick outline around a complication to highlight it.

Summary

Public constructors

ComplicationHighlightRenderer(
    @Px float outlineExpansion,
    @Px float outlineStrokeWidth
)

Public methods

final void
drawComplicationHighlight(
    @NonNull Canvas canvas,
    @NonNull Rect bounds,
    @ColorInt int color
)

Intended for use by CanvasComplicationDrawable.drawHighlight.

Public constructors

ComplicationHighlightRenderer

Added in 1.0.0
public ComplicationHighlightRenderer(
    @Px float outlineExpansion,
    @Px float outlineStrokeWidth
)

Public methods

drawComplicationHighlight

Added in 1.0.0
public final void drawComplicationHighlight(
    @NonNull Canvas canvas,
    @NonNull Rect bounds,
    @ColorInt int color
)

Intended for use by CanvasComplicationDrawable.drawHighlight. Draws a thick line around the complication with color and with the given bounds. Fills the center of the complication with transparent white. When composited on top of the underlying watchface the complication's original pixels will be preserved with their original brightness.