Function

updateLayerBlock

Updates the layer block of the LayoutModifierNode.

updateLayerBlock

Source set: Common
public fun LayoutModifierNode.updateLayerBlock(layerBlock: (GraphicsLayerScope.() -> Unit)?)

Updates the layer block of the LayoutModifierNode. This will mark the layer as invalidated and schedule a refresh of the layer.

Updating the layer lambda using this method is cheaper than invalidating placement and placing the layout with a new layer block. This API is expected to be used alongside Placeable.placeAt with a layerBlock parameter passed. This will override/update the layerBlock passed in that API. Whichever one was called last should "win".

Parameters

layerBlock the snapshot-observed lambda used to set properties on the layer. if null, is provided it will remove the layer.
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: