Android 12 Developer Preview is here! Try it out, and give us your feedback!

SemanticsPropertyReceiver

interface SemanticsPropertyReceiver
androidx.compose.ui.semantics.SemanticsPropertyReceiver

SemanticsPropertyReceiver is the scope provided by semantics {} blocks, letting you set key/value pairs primarily via extension functions.

Summary

Public methods
abstract operator Unit
set(key: SemanticsPropertyKey<T>, value: T)

Extension functions
From androidx.compose.ui.semantics
Unit
SemanticsPropertyReceiver.collapse(label: String? = null, action: () -> Boolean)

Action to collapse an expandable node.

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

Action to copy the text to the clipboard.

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

Action to cut the text and copy it to the clipboard.

Unit

Whether this element is a Dialog.

Unit

Whether this semantics node is disabled.

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

Action to dismiss a dismissible node.

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

Action to expand an expandable node.

Unit

Action to get a Text/TextField node's TextLayoutResult.

Unit

The node is marked as heading for accessibility.

Unit

Whether this node is specially known to be invisible to the user.

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

Action to be performed when the node is clicked (single-tapped).

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

Action to be performed when the node is long clicked (long-pressed).

Unit

The node is marked as a password.

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

This function adds the SemanticsActions.PasteText to the SemanticsPropertyReceiver.

Unit

Whether this semantics node represents a Popup.

Unit