{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

SubcomposeLayoutState.PrecomposedSlotHandle

public interface SubcomposeLayoutState.PrecomposedSlotHandle


Instance of this interface is returned by precompose function.

Summary

Public methods

abstract void

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

default int

The amount of placeables composed into this slot.

default void
premeasure(int index, @NonNull Constraints constraints)

Performs synchronous measure of the placeable at the given index.

Public methods

dispose

abstract void dispose()

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.

getPlaceablesCount

default int getPlaceablesCount()

The amount of placeables composed into this slot.

premeasure

default void premeasure(int index, @NonNull Constraints constraints)

Performs synchronous measure of the placeable at the given index.

Parameters
int index

the placeable index. Should be smaller than placeablesCount.

@NonNull Constraints constraints

Constraints to measure this placeable with.