RelativeLayoutBounds


Represents an axis-aligned bounding Rectangle for an element in a compose hierarchy, in the coordinates of either the Root of the compose hierarchy, the Window, or the Screen.

Summary

Public functions

List<IntRect>

At the current state of the layout, calculates which other Composable Layouts are occluding the Composable associated with this RelativeLayoutBounds.

Cmn

Public properties

IntRect

The positioned bounding Rect in the coordinates of the root node of the compose hierarchy.

Cmn
IntRect

The positioned bounding Rect in the coordinates of the Screen which it is contained in.

Cmn
IntRect

The positioned bounding Rect in the coordinates of the Window which it is contained in.

Cmn
Int

The height, in pixels, of the Rect

Cmn
IntOffset

The top left position of the Rect in the coordinates of the root node of the compose hierarchy.

Cmn
IntOffset

The top left position of the Rect in the coordinates of the Screen it is contained in.

Cmn
IntOffset

The top left position of the Rect in the coordinates of the Window it is contained in

Cmn
Int

The width, in pixels, of the Rect

Cmn

Public functions

calculateOcclusions

fun calculateOcclusions(): List<IntRect>

At the current state of the layout, calculates which other Composable Layouts are occluding the Composable associated with this RelativeLayoutBounds. Note: Calling this method during measure or layout may result on calculations with stale (or partially stale) layout information.

An occlusion is defined by an intersecting Composable that may draw on top of the target Composable.

There's no guarantee that something was actually drawn to occlude, so a transparent Composable that could otherwise draw on top of the target is considered to be occluding.

There's no differentiation between partial and complete occlusions, they are all included as part of this calculation.

Ancestors, child and grandchild Layouts are never considered to be occluding.

Returns
List<IntRect>

A List of the rectangles that occlude the associated Composable Layout.

Public properties

boundsInRoot

val boundsInRootIntRect

The positioned bounding Rect in the coordinates of the root node of the compose hierarchy.

boundsInScreen

val boundsInScreenIntRect

The positioned bounding Rect in the coordinates of the Screen which it is contained in.

boundsInWindow

val boundsInWindowIntRect

The positioned bounding Rect in the coordinates of the Window which it is contained in.

height

val heightInt

The height, in pixels, of the Rect

positionInRoot

val positionInRootIntOffset

The top left position of the Rect in the coordinates of the root node of the compose hierarchy.

positionInScreen

val positionInScreenIntOffset

The top left position of the Rect in the coordinates of the Screen it is contained in.

positionInWindow

val positionInWindowIntOffset

The top left position of the Rect in the coordinates of the Window it is contained in

width

val widthInt

The width, in pixels, of the Rect