Android 12 Developer Preview is here! Try it out, and give us your feedback!

OnRemeasuredModifier

interface OnRemeasuredModifier : Modifier.Element
androidx.compose.ui.layout.OnRemeasuredModifier

A modifier whose onRemeasured is called when the layout content is remeasured. The most common usage is onSizeChanged.

Example usage:

import androidx.compose.material.Text
import androidx.compose.ui.layout.onSizeChanged

// Use onSizeChanged() for diagnostics. Use Layout or SubcomposeLayout if you want
// to use the size of one component to affect the size of another component.
Text(
    "Hello $name",
    Modifier.onSizeChanged { size ->
        println("The size of the Text in pixels is $size")
    }
)

Summary

Public methods
abstract Unit

Called after a layout's contents have been remeasured.

Inherited functions
Inherited extension functions
From androidx.compose.foundation.layout
Modifier
Modifier.absoluteOffset(x: Dp = 0.dp, y: Dp = 0.dp)

Offset the content by (x dp, y dp).

Modifier

Offset the content by offset px.

Modifier
Modifier.absolutePadding(left: Dp = 0.dp, top: Dp = 0.dp, right: Dp = 0.dp, bottom: Dp = 0.dp)

Apply additional space along each edge of the content in Dp: left, top, right and