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

IntermediateMeasureScope


IntermediateMeasureScope provides access to lookahead results to allow intermediateLayout to leverage lookahead results to define intermediate measurements and placements to gradually converge with lookahead.

IntermediateMeasureScope.lookaheadSize provides the target size of the layout. IntermediateMeasureScope is also a LookaheadScope, thus allowing layouts to read their LookaheadLayoutCoordinates during placement using LookaheadScope.toLookaheadCoordinates, as well as the LookaheadLayoutCoordinates of the closest lookahead scope via LookaheadScope.lookaheadScopeCoordinates. By knowing the target size and position, layout adjustments such as animations can be defined in intermediateLayout to morph the layout gradually in both size and position to arrive at its precalculated bounds.

Note that IntermediateMeasureScope is the closest lookahead scope in the tree. This LookaheadScope enables convenient query of the layout's relative position to the LookaheadScope. Hence it becomes straightforward to animate position relative to the closest scope, which usually yields a natural looking animation, unless there are specific UX requirements to change position relative to a particular LookaheadScope.

IntermediateMeasureScope is a CoroutineScope, as a convenient scope for all the coroutine-based intermediate changes (e.g. animations) to be launched from.

Summary

Public properties

IntSize

Indicates the target size of the intermediateLayout.

Cmn

Inherited functions

From androidx.compose.ui.unit.Density
open Int

Convert Dp to Int by rounding

Cmn
open Int

Convert Sp to Int by rounding

Cmn
open Dp

Convert Sp to Dp.

Cmn
open Dp

Convert an Int pixel value to Dp.

Cmn
open Dp

Convert a Float pixel value to a Dp

Cmn
open DpSize

Convert a Size to a DpSize.

Cmn
open Float

Convert Dp to pixels.

Cmn
open Float

Convert Sp to pixels.

Cmn
open Rect

Convert a DpRect to a Rect.

Cmn
open Size

Convert a DpSize to a Size.

Cmn
open TextUnit

Convert Dp to Sp.

Cmn
open TextUnit

Convert an Int pixel value to Sp.

Cmn
open TextUnit

Convert a Float pixel value to a Sp

Cmn
From androidx.compose.ui.layout.LookaheadScope
open Modifier
Modifier.intermediateLayout(
    measure: MeasureScope.(measurable: Measurable, constraints: Constraints, lookaheadSize: IntSize) -> MeasureResult
)

This function is deprecated.

Cmn
open Offset

Calculates the localPosition in the Lookahead coordinate space.

Cmn
Modifier
Modifier.onPlaced(
    onPlaced: (lookaheadScopeCoordinates: LookaheadLayoutCoordinates, layoutCoordinates: LookaheadLayoutCoordinates) -> Unit
)

This function is deprecated. onPlaced in LookaheadLayoutScope has been deprecated.

Cmn
LayoutCoordinates

Converts a LayoutCoordinates into a LayoutCoordinates in the Lookahead coordinates space.

Cmn
From androidx.compose.ui.layout.MeasureScope
open MeasureResult
layout(
    width: Int,
    height: Int,
    alignmentLines: Map<AlignmentLineInt>,
    placementBlock: Placeable.PlacementScope.() -> Unit
)

Sets the size and alignment lines of the measured layout, as well as the positioning block that defines the children positioning logic.

Cmn

Inherited properties

From androidx.compose.ui.unit.Density
Float

The logical density of the display.

Cmn
Float

Current user preference for the scaling factor for fonts.

Cmn
From androidx.compose.ui.layout.IntrinsicMeasureScope
open Boolean

This indicates whether the ongoing measurement is for lookahead pass.

Cmn
LayoutDirection

The LayoutDirection of the Layout or LayoutModifier using the measure scope to measure their children.

Cmn
From androidx.compose.ui.layout.LookaheadScope

Public properties

lookaheadSize

val lookaheadSizeIntSize

Indicates the target size of the intermediateLayout.