androidx.ui.core.semantics

Classes

SemanticsConfiguration

Describes the semantic information associated with the owning component

SemanticsHintOverrides

Provides hint values which override the default hints on supported platforms.

SemanticsNode

A node that represents some semantic data.

SemanticsOwner

Owns SemanticsNode objects and notifies listeners of changes to the semantics tree

Extension functions summary

For SemanticsNode
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.

For SemanticsOwner
List<SemanticsNode>

Finds all SemanticsNodes in the tree owned by this SemanticsOwner.

For SemanticsConfiguration
T?

For Modifier
Modifier
Modifier.semantics(applyToChildLayoutNode: Boolean = false, mergeAllDescendants: Boolean = false, properties: SemanticsPropertyReceiver.() -> Unit = null)

Add semantics key/value for use in testing, accessibility, and similar use cases.

Extension functions

findClosestParentNode

fun SemanticsNode.findClosestParentNode(selector: (SemanticsNode) -> Boolean): 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.

getAllSemanticsNodes

fun SemanticsOwner.getAllSemanticsNodes(): List<SemanticsNode>

Finds all SemanticsNodes in the tree owned by this SemanticsOwner. Return the results in a list.

getOrNull

fun <T> SemanticsConfiguration.getOrNull(key: SemanticsPropertyKey<T>): T?

semantics

fun Modifier.semantics(
    applyToChildLayoutNode: Boolean = false,
    mergeAllDescendants: Boolean = false,
    properties: SemanticsPropertyReceiver.() -> Unit = null
): Modifier

Add semantics key/value for use in testing, accessibility, and similar use cases.

Parameters
applyToChildLayoutNode: Boolean = false If true, then the semantics modifier applies to the first layout node below it in the tree, not the composable the modifier is applied to. This is for use by legacy non-modifier-style semantics and is planned to be removed (with the behavior 'false' made universal).
mergeAllDescendants: Boolean = false Whether the semantic information provided by the owning component and all of its descendants should be treated as one logical entity.
properties: SemanticsPropertyReceiver.() -> Unit = null properties to add to the semantics. SemanticsPropertyReceiver will be provided in the scope to allow access for common properties and its values.