SemanticsConfiguration

class SemanticsConfiguration : SemanticsPropertyReceiver, Iterable<Entry<SemanticsPropertyKey<*>, Any?>>
kotlin.Any
   ↳ androidx.ui.core.semantics.SemanticsConfiguration

Describes the semantic information associated with the owning component

The information provided in the configuration is used to to generate the semantics tree.

Summary

Public constructors

Describes the semantic information associated with the owning component

Public methods

operator Boolean

SemanticsConfiguration

Returns an exact copy of this configuration.

operator T

Retrieves the value for the given property, if one has been set.

T
getOrElse(key: SemanticsPropertyKey<T>, defaultValue: () -> T)

T?
getOrElseNullable(key: SemanticsPropertyKey<T>, defaultValue: () -> T?)

Iterator<Entry<SemanticsPropertyKey<*>, Any?>>

Unit
set(key: SemanticsPropertyKey<T>, value: T)

Extension functions

From androidx.ui.test
Unit

SemanticsConfiguration

Returns a (mutated) copy of the original SemanticsConfiguration object.

From androidx.ui.core.semantics
T?

Inherited extension functions

From androidx.ui.semantics
Unit
SemanticsPropertyReceiver.ScrollTo(label: String? = null, action: (x: Px, y: Px) -> Unit)

Unit
SemanticsPropertyReceiver.onClick(label: String? = null, action: () -> Unit)

Properties

Boolean

Whether the configuration forces all children of the owning component that want to contribute semantic information to the semantics tree to do so in the form of explicit SemanticsNodes.

Boolean

Whether this configuration is empty.

Boolean

Whether the semantic information provided by the owning component and all of its descendants should be treated as one logical entity.

Boolean

Whether the owner of this configuration wants to own its own SemanticsNode.

Extension properties

From androidx.ui.test
Boolean

Boolean

Boolean

Verifies that a component is in a mutually exclusive group - that is, that FoundationSemanticsProperties.InMutuallyExclusiveGroup is set to true

Boolean

Verifies that a component is checkable.

Inherited extension properties

From androidx.ui.semantics
AccessibilityAction<(x: Px, y: Px) -> Unit>

String

String

List<AccessibilityAction<() -> Unit>>

Boolean

Boolean

AccessibilityAction<() -> Unit>

String

TextDirection

From androidx.ui.foundation.semantics
Boolean

Boolean

ToggleableState

Public constructors

<init>

SemanticsConfiguration()

Describes the semantic information associated with the owning component

The information provided in the configuration is used to to generate the semantics tree.

Public methods

contains

operator fun <T> contains(key: SemanticsPropertyKey<T>): Boolean

copy

fun copy(): SemanticsConfiguration

Returns an exact copy of this configuration.

get

operator fun <T> get(key: SemanticsPropertyKey<T>): T

Retrieves the value for the given property, if one has been set. If a value has not been set, throws IllegalStateException

getOrElse

fun <T> getOrElse(
    key: SemanticsPropertyKey<T>,
    defaultValue: () -> T
): T

getOrElseNullable

fun <T> getOrElseNullable(
    key: SemanticsPropertyKey<T>,
    defaultValue: () -> T?
): T?

iterator

fun iterator(): Iterator<Entry<SemanticsPropertyKey<*>, Any?>>

set

fun <T> set(
    key: SemanticsPropertyKey<T>,
    value: T
): Unit

Properties

explicitChildNodes

var explicitChildNodes: Boolean

Whether the configuration forces all children of the owning component that want to contribute semantic information to the semantics tree to do so in the form of explicit SemanticsNodes.

When set to false children of the owning component are allowed to annotate SemanticNodes of their parent with the semantic information they want to contribute to the semantic tree. When set to true the only way for children of the owning component to contribute semantic information to the semantic tree is to introduce new explicit SemanticNodes to the tree.

This setting is often used in combination with isSemanticBoundary to create semantic boundaries that are either writable or not for children.

hasBeenAnnotated

val hasBeenAnnotated: Boolean

Whether this configuration is empty.

An empty configuration doesn't contain any semantic information that it wants to contribute to the semantics tree.

isMergingSemanticsOfDescendants

var isMergingSemanticsOfDescendants: Boolean

Whether the semantic information provided by the owning component and all of its descendants should be treated as one logical entity.

If set to true, the descendants of the owning component's SemanticsNode will merge their semantic information into the SemanticsNode representing the owning component.

Setting this to true requires that isSemanticBoundary is also true.

isSemanticBoundary

var isSemanticBoundary: Boolean

Whether the owner of this configuration wants to own its own SemanticsNode.

When set to true semantic information associated with the owner of this configuration or any of its descendants will not leak into parents. The SemanticsNode generated out of this configuration will act as a boundary.

Whether descendants of the owning component can add their semantic information to the SemanticsNode introduced by this configuration is controlled by explicitChildNodes.

This has to be true if isMergingSemanticsOfDescendants is also true.