BringIntoViewModifierNode

Interface

Common
interface BringIntoViewModifierNode : DelegatableNode

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

Functions

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

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

childCoordinatesThe LayoutCoordinates of the child node making the request. This parent can use these LayoutCoordinates to translate boundsProvider into its own coordinates.
boundsProviderA 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.