BringIntoViewModifierNode


A node that can respond to bringIntoView requests from its children by moving or adjusting its content.

Summary

Public functions

suspend Unit
bringIntoView(
    childCoordinates: LayoutCoordinates,
    boundsProvider: () -> Rect?
)

Moves or adjusts this node's content so that boundsProvider will be in visible bounds.

Cmn

Inherited functions

From androidx.compose.ui.node.DelegatableNode
open Unit

Invoked when the density changes for this node.

Cmn
open Unit

Invoked when the layout direction changes for this node.

Cmn

Inherited properties

From androidx.compose.ui.node.DelegatableNode
Modifier.Node

A reference of the Modifier.Node that holds this node's position in the node hierarchy.

Cmn

Public functions

bringIntoView

suspend fun bringIntoView(
    childCoordinates: LayoutCoordinates,
    boundsProvider: () -> Rect?
): Unit

Moves or adjusts this node's content so that boundsProvider will be in visible bounds. Must ensure that the request is propagated up to the parent node.

This method will not return until this request has been satisfied or interrupted by a newer request.

Parameters
childCoordinates: LayoutCoordinates

The LayoutCoordinates of the child node making the request. This parent can use these LayoutCoordinates to translate boundsProvider into its own coordinates.

boundsProvider: () -> Rect?

A function returning the rectangle to bring into view, relative to childCoordinates. The function may return a different value over time, if the bounds of the request change while the request is being processed. If the rectangle cannot be calculated, e.g. because childCoordinates is not attached, return null.