WindowInsets
interface WindowInsets
A representation of window insets that tracks access to enable recomposition, relayout, and
redrawing when values change. These values should not be read during composition to avoid doing
composition for every frame of an animation. Use methods like Modifier.windowInsetsPadding
,
Modifier.systemBarsPadding
, and Modifier.windowInsetsTopHeight
for Modifiers that will not
cause recomposition when values change.
Use the WindowInsets.Companion
extensions to retrieve WindowInsets
for the current window.
Functions
fun getLeft(density: Density, layoutDirection: LayoutDirection): Int
The space, in pixels, at the left of the window that the inset represents.
fun getTop(density: Density): Int
The space, in pixels, at the top of the window that the inset represents.
fun getRight(density: Density, layoutDirection: LayoutDirection): Int
The space, in pixels, at the right of the window that the inset represents.
fun getBottom(density: Density): Int
The space, in pixels, at the bottom of the window that the inset represents.