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

ComplicationBounds

class ComplicationBounds
kotlin.Any
   ↳ androidx.wear.complications.ComplicationBounds

ComplicationBounds are defined by fractional screen space coordinates in unit-square 0..1. These bounds will be subsequently clamped to the unit square and converted to screen space coordinates. NB 0 and 1 are included in the unit square.

One bound is expected per ComplicationType to allow complications to change shape depending on the type.

Summary

Public constructors
<init>(bounds: RectF)

Constructs a ComplicationBounds where all complication types have the same screen space unit-square bounds.

<init>(perComplicationTypeBounds: Map<ComplicationType, RectF>)

ComplicationBounds are defined by fractional screen space coordinates in unit-square 0..1.

Properties
Map<ComplicationType, RectF>

Per ComplicationType fractional unit-square screen space complication bounds.

Public constructors

<init>

ComplicationBounds(bounds: RectF)

Constructs a ComplicationBounds where all complication types have the same screen space unit-square bounds.

<init>

ComplicationBounds(perComplicationTypeBounds: Map<ComplicationType, RectF>)

ComplicationBounds are defined by fractional screen space coordinates in unit-square 0..1. These bounds will be subsequently clamped to the unit square and converted to screen space coordinates. NB 0 and 1 are included in the unit square.

One bound is expected per ComplicationType to allow complications to change shape depending on the type.

Properties

perComplicationTypeBounds

val perComplicationTypeBounds: Map<ComplicationType, RectF>

Per ComplicationType fractional unit-square screen space complication bounds.