Google is committed to advancing racial equity for Black communities. See how.

SemanticsNode

class SemanticsNode
kotlin.Any
   ↳ androidx.ui.core.semantics.SemanticsNode

A list of key/value pairs associated with a layout node or its subtree.

Each SemanticsNode takes its id and initial key/value list from the outermost modifier on one layout node. It also contains the "collapsed" configuration of any other semantics modifiers on the same layout node, and if "mergeDescendants" is specified and enabled, also the "merged" configuration of its subtree.

Summary

Public methods
Int

Returns the position of an alignment line, or AlignmentLine.Unspecified if the line is not provided.

Extension functions
From androidx.ui.core.semantics
SemanticsNode?

Executes selector on every parent of this SemanticsNode and returns the closest SemanticsNode to return true from selector or null if selector returns false for all ancestors.

Properties
PxBounds

The bounding box for this node relative to the root of this Compose hierarchy

List<SemanticsNode>

Contains the children in inverse hit test order (i.

LayoutNode

SemanticsConfiguration

The list of semantics properties of this node.

PxBounds

Offset

Int

Boolean

Whether this SemanticNode is the root of a tree or not

Boolean

mergingEnabled specifies whether mergeAllDescendants config has any effect.

SemanticsNode?

The parent of this node in the tree.

IntSize

The size of the bounding box for this node

Public methods

getAlignmentLinePosition

fun getAlignmentLinePosition(line: AlignmentLine): Int

Returns the position of an alignment line, or AlignmentLine.Unspecified if the line is not provided.

Properties

boundsInRoot

val boundsInRoot: PxBounds

The bounding box for this node relative to the root of this Compose hierarchy

children

val children: List<SemanticsNode>

Contains the children in inverse hit test order (i.e. paint order).

Note that if mergingEnabled and mergeAllDescendants are both true, then there are no children (except those that are themselves mergeAllDescendants).

componentNode

val componentNode: LayoutNode

config

val config: SemanticsConfiguration

The list of semantics properties of this node.

This includes all properties attached as modifiers to the current layout node. In addition, if mergeAllDescendants and mergingEnabled are both true, then it also includes the semantics properties of descendant nodes.

globalBounds

val globalBounds: PxBounds

globalPosition

val globalPosition: Offset

id

val id: Int

isRoot

val isRoot: Boolean

Whether this SemanticNode is the root of a tree or not

mergingEnabled

val mergingEnabled: Boolean

mergingEnabled specifies whether mergeAllDescendants config has any effect.

If true, then mergeAllDescendants nodes will merge up all properties from child semantics nodes and remove those children from "children", with the exception of nodes that themselves have mergeAllDescendants. If false, then mergeAllDescendants has no effect.

mergingEnabled is typically true or false consistently on every node of a SemanticsNode tree.

parent

val parent: SemanticsNode?

The parent of this node in the tree.

size

val size: IntSize

The size of the bounding box for this node