Android 12 Developer Preview is here! Try it out, and give us your feedback!

RenderParameters

class RenderParameters
kotlin.Any
   ↳ androidx.wear.watchface.RenderParameters

Used to parameterize watch face rendering.

Summary

Public constructors
<init>(drawMode: DrawMode, layerParameters: Map<Layer, LayerMode>, selectedComplicationId: Int?)

Constructs RenderParameters without an explicit outlineTint.

<init>(wireFormat: RenderParametersWireFormat)

<init>(drawMode: DrawMode, layerParameters: Map<Layer, LayerMode>, selectedComplicationId: Int?, @ColorInt outlineTint: Int)

Used to parameterize watch face rendering.

Public methods
RenderParametersWireFormat

Properties
DrawMode

The overall drawing parameters based on system state.

Map<Layer, LayerMode>

Parameters for rendering individual layers.

Int

Specifies the tint should be used with LayerMode.DRAW_OUTLINED .

Int?

Optional parameter which if non null specifies that a particular complication should be drawn with a special highlight to indicate it's been selected.

Companion properties
RenderParameters

Default RenderParameters which draws everything in interactive mode.

Map<Layer, LayerMode>

A layerParameters map where all Layers have LayerMode.DRAW.

Public constructors

<init>

RenderParameters(
    drawMode: DrawMode,
    layerParameters: Map<Layer, LayerMode>,
    selectedComplicationId: Int?)

Constructs RenderParameters without an explicit outlineTint. This constructor doesn't support LayerMode.DRAW_OUTLINED.

<init>

RenderParameters(wireFormat: RenderParametersWireFormat)

<init>

RenderParameters(
    drawMode: DrawMode,
    layerParameters: Map<Layer, LayerMode>,
    selectedComplicationId: Int?,
    @ColorInt outlineTint: Int)

Used to parameterize watch face rendering.

Public methods

toWireFormat

fun toWireFormat(): RenderParametersWireFormat

Properties

drawMode

val drawMode: DrawMode

The overall drawing parameters based on system state.

layerParameters

val layerParameters: Map<Layer, LayerMode>

Parameters for rendering individual layers. Generally these will all be LayerMode#DRAW in normal operation, but the editor may make more complicated requests which need to be honored to function properly.

outlineTint

val outlineTint: Int

Specifies the tint should be used with LayerMode.DRAW_OUTLINED .

selectedComplicationId

val selectedComplicationId: Int?

Optional parameter which if non null specifies that a particular complication should be drawn with a special highlight to indicate it's been selected.

Companion properties

DEFAULT_INTERACTIVE

val DEFAULT_INTERACTIVE: RenderParameters

Default RenderParameters which draws everything in interactive mode.

DRAW_ALL_LAYERS

val DRAW_ALL_LAYERS: Map<Layer, LayerMode>

A layerParameters map where all Layers have LayerMode.DRAW.