Interface

OnPlacedModifier

A modifier whose [onPlaced] is called after the parent [LayoutModifier] and parent layout has been placed and before child [LayoutModifier] is placed.

Common
@JvmDefaultWithCompatibility
interface OnPlacedModifier : Modifier.Element

A modifier whose onPlaced is called after the parent LayoutModifier and parent layout has been placed and before child LayoutModifier is placed. This allows child LayoutModifier to adjust its own placement based on where the parent is.

Functions

onPlaced

fun onPlaced(coordinates: LayoutCoordinates)

onPlaced is called after parent LayoutModifier and parent layout gets placed and before any child LayoutModifier is placed.

coordinates provides LayoutCoordinates of the OnPlacedModifier. Placement in both parent LayoutModifier and parent layout can be calculated using the LayoutCoordinates.