DrawCacheModifier


DrawModifier implementation that supports building a cache of objects to be referenced across draw calls

Summary

Public functions

Unit

Callback invoked to re-build objects to be re-used across draw calls.

Cmn

Inherited functions

From androidx.compose.ui.draw.DrawModifier
From androidx.compose.ui.Modifier
open infix Modifier
then(other: Modifier)

Concatenates this modifier with another.

Cmn
From androidx.compose.ui.Modifier.Element
open Boolean
all(predicate: (Modifier.Element) -> Boolean)

Returns true if predicate returns true for all Elements in this Modifier or if this Modifier contains no Elements.

Cmn
open Boolean
any(predicate: (Modifier.Element) -> Boolean)

Returns true if predicate returns true for any Element in this Modifier.

Cmn
open R
<R : Any?> foldIn(initial: R, operation: (Modifier.Element, R) -> R)

Accumulates a value starting with initial and applying operation to the current value and each element from outside in.

Cmn
open R
<R : Any?> foldOut(initial: R, operation: (Modifier.Element, R) -> R)

Accumulates a value starting with initial and applying operation to the current value and each element from inside out.

Cmn

Public functions

onBuildCache

fun onBuildCache(params: BuildDrawCacheParams): Unit

Callback invoked to re-build objects to be re-used across draw calls. This is useful to conditionally recreate objects only if the size of the drawing environment changes, or if state parameters that are inputs to objects change. This method is guaranteed to be called before DrawModifier.draw.

Parameters
params: BuildDrawCacheParams

The params to be used to build the cache.