androidx.compose.ui.layout
onLayoutRectChangedSince 1.8
Function · from org.jetbrains.compose.ui:ui:1.12.2
No hand-written docs yet.
Invokes callback with the position of this layout node relative to the coordinate system of the root of the composition, as well as in screen coordinates and window coordinates. This will be called after layout pass. This API allows for throttling and debouncing parameters in order to moderate the frequency with which the callback gets invoked during high rates of change (e.g. scrolling).
Parameters
fun Modifier.onLayoutRectChanged(
throttleMillis: Long = 0,
debounceMillis: Long = 64,
callback: (RelativeLayoutBounds) -> Unit,
)
throttleMillis: LongOptional
throttleMillis: LongOptionalDefault: 0
The duration, in milliseconds, to prevent callback from being executed more than once over that time period.
debounceMillis: LongOptional
debounceMillis: LongOptionalDefault: 64
The duration, in milliseconds, to delay the execution of callback until that amount of time has elapsed without a new position.
callback: (RelativeLayoutBounds) -> UnitRequired
callback: (RelativeLayoutBounds) -> UnitRequiredThe callback to be executed.
Library docs
Invokes callback with the position of this layout node relative to the coordinate system of the
root of the composition, as well as in screen coordinates and window coordinates. This will be
called after layout pass. This API allows for throttling and debouncing parameters in order to
moderate the frequency with which the callback gets invoked during high rates of change (e.g.
scrolling).
Specifying throttleMillis will prevent callback from being executed more than once over that
time period. Specifying debounceMillis will delay the execution of callback until that amount
of time has elapsed without a new position, scheduling the callback to be executed when that
amount of time expires.
Specifying 0 for both throttleMillis and debounceMillis will result in the callback being
executed every time the position has changed. Specifying non-zero amounts for both will result in
both conditions being met. Specifying a non-zero throttleMillis but a zero debounceMillis is
equivalent to providing the same value for both throttleMillis and debounceMillis.