Google is committed to advancing racial equity for Black communities. See how.

CacheDrawScope

class CacheDrawScope : Density
kotlin.Any
   ↳ androidx.compose.ui.CacheDrawScope

Handle to a drawing environment that enables caching of content based on the resolved size. Consumers define parameters and refer to them in the captured draw callback provided in onDraw

Summary

Public methods
DrawResult
onDraw(block: DrawScope.() -> Unit)

Specify the callback to be invoked to issue drawing commands

Inherited functions
Inherited extension functions
From androidx.compose.foundation.layout
Constraints

Creates the Constraints corresponding to the current DpConstraints.

DpConstraints

Creates the DpConstraints corresponding to the current Constraints.

Properties
Float

The logical density of the display.

Float

Current user preference for the scaling factor for fonts.

Size

Provides the dimensions of the current drawing environment

Public methods

onDraw

fun onDraw(block: DrawScope.() -> Unit): DrawResult

Specify the callback to be invoked to issue drawing commands

Properties

density

val density: Float

The logical density of the display. This is a scaling factor for the Dp unit.

fontScale

val fontScale: Float

Current user preference for the scaling factor for fonts.

size

var size: Size

Provides the dimensions of the current drawing environment