SubcomposeLayoutState.PrecomposedSlotHandle


Instance of this interface is returned by precompose function.

Summary

Public functions

Unit

This function allows to dispose the content for the slot which was precomposed previously via precompose.

Cmn
open Unit
premeasure(index: Int, constraints: Constraints)

Performs synchronous measure of the placeable at the given index.

Cmn
open Unit

Conditionally executes block for each Modifier.Node of this Composition that is a TraversableNode with a matching key.

Cmn

Public properties

open Int

The amount of placeables composed into this slot.

Cmn

Public functions

dispose

fun dispose(): Unit

This function allows to dispose the content for the slot which was precomposed previously via precompose.

If this slot was already used during the regular measure pass via SubcomposeMeasureScope.subcompose this function will do nothing.

This could be useful if after the future calculations this item is not anymore expected to be used during the measure pass anytime soon.

premeasure

open fun premeasure(index: Int, constraints: Constraints): Unit

Performs synchronous measure of the placeable at the given index.

Parameters
index: Int

the placeable index. Should be smaller than placeablesCount.

constraints: Constraints

Constraints to measure this placeable with.

traverseDescendants

open fun traverseDescendants(
    key: Any?,
    block: (TraversableNode) -> TraversableNode.Companion.TraverseDescendantsAction
): Unit

Conditionally executes block for each Modifier.Node of this Composition that is a TraversableNode with a matching key.

See androidx.compose.ui.node.traverseDescendants for the complete semantics of this function.

Public properties

placeablesCount

open val placeablesCountInt

The amount of placeables composed into this slot.