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

OwnedLayer

interface OwnedLayer
androidx.compose.ui.node.OwnedLayer

A layer returned by Owner.createLayer to separate drawn content. An OwnedLayer has the implementation to make DrawLayerModifiers work.

Summary

Public methods
abstract Unit

Indicates that the layer is no longer needed.

abstract Unit
drawLayer(canvas: Canvas)

Causes the layer to be drawn into canvas

abstract Unit
getMatrix(matrix: Matrix)

Modifies matrix to be the transform that this layer applies to its content.

abstract Unit

Asks to the layer to redraw itself without forcing all of its parents to redraw.

abstract Unit
move(position: IntOffset)

Changes the position of the layer contents.

abstract Unit
resize(size: IntSize)

Changes the size of the layer's drawn area.

abstract Unit

Updates the drawing on the current canvas.

abstract Unit

Reads the DrawLayerModifier and dirties the layer so that it will be redrawn.

Properties
abstract Long

The ID of the layer.

abstract DrawLayerModifier

The DrawLayerModifier used in this layer.

Public methods

destroy

abstract fun destroy(): Unit

Indicates that the layer is no longer needed.

drawLayer

abstract fun drawLayer(canvas: Canvas): Unit

Causes the layer to be drawn into canvas

getMatrix

abstract fun getMatrix(matrix: Matrix): Unit

Modifies matrix to be the transform that this layer applies to its content.

invalidate

abstract fun invalidate(): Unit

Asks to the layer to redraw itself without forcing all of its parents to redraw.

move

abstract fun move(position: IntOffset): Unit

Changes the position of the layer contents.

resize

abstract fun resize(size: IntSize): Unit

Changes the size of the layer's drawn area.

updateDisplayList

abstract fun updateDisplayList(): Unit

Updates the drawing on the current canvas.

updateLayerProperties

abstract fun updateLayerProperties(): Unit

Reads the DrawLayerModifier and dirties the layer so that it will be redrawn.

Properties

layerId

abstract val layerId: Long

The ID of the layer. This is used by tooling to match a layer to the associated LayoutNode.

modifier

abstract var modifier: DrawLayerModifier

The DrawLayerModifier used in this layer.