The second Android 11 Developer Preview is now available, test it out and share your feedback.

CanvasScope

interface CanvasScope : Canvas, Density
androidx.ui.foundation.CanvasScope

Interface that provides everything you need to draw on Canvas. This includes androidx.ui.graphics.Canvas scoping, Density and size of the Canvas, already converted to pixels

Summary

Inherited functions

Inherited extension functions

From androidx.ui.layout
Constraints

Creates the Constraints corresponding to the current DpConstraints.

DpConstraints

Creates the DpConstraints corresponding to the current Constraints.

From androidx.ui.graphics
Unit
Canvas.drawOutline(outline: Outline, paint: Paint)

Draws the Outline on a Canvas.

Unit
Canvas.withSave(block: () -> Unit)

Saves a copy of the current transform and clip on the save stack and executes the provided lambda with the current transform applied.

Unit
Canvas.withSaveLayer(bounds: Rect, paint: Paint, block: () -> Unit)

Saves a copy of the current transform and clip on the save stack, and then creates a new group which subsequent calls will become a part of.

Properties

abstract PxSize

Inherited properties

Properties

size

abstract val size: PxSize