androidx.ui.semantics

Interfaces

SemanticsPropertyReceiver

Classes

AccessibilityAction

Data class for standard accessibility action.

AccessibilityRangeInfo

CustomAccessibilityAction

Data class for custom accessibility action.

SemanticsPropertyKey

Extension functions summary

For SemanticsPropertyReceiver
Unit

Whether this semantics node is disabled.

Unit

Whether this semantics node is hidden.

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

This function adds the SemanticsActions.OnClick to the SemanticsPropertyReceiver.

Unit

Whether this semantics node represents a Popup.

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

This function adds the SemanticsActions.ScrollBackward to the SemanticsPropertyReceiver.

Unit
SemanticsPropertyReceiver.scrollBy(label: String? = null, action: (x: Float, y: Float) -> Boolean)

This function adds the SemanticsActions.ScrollBy to the SemanticsPropertyReceiver.

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

This function adds the SemanticsActions.ScrollForward to the SemanticsPropertyReceiver.

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

This function adds the SemanticsActions.SetProgress to the SemanticsPropertyReceiver.

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

This function adds the SemanticsActions.SetSelection to the SemanticsPropertyReceiver.

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

This function adds the SemanticsActions.SetText to the SemanticsPropertyReceiver.

Extension properties summary

For SemanticsPropertyReceiver
String

Developer-set content description of the semantics node.

String

Developer-set state description of the semantics node.

AccessibilityRangeInfo

The node is a range with current value.

List<CustomAccessibilityAction>

Custom actions which are defined by app developers.

Boolean

Whether this semantics node is focused.

String

Test tag attached to this semantics node.

AnnotatedString

Text of the semantics node.

TextRange

Text selection range for edit text.

Extension functions

disabled

fun SemanticsPropertyReceiver.disabled(): Unit

Whether this semantics node is disabled.

hidden

fun SemanticsPropertyReceiver.hidden(): Unit

Whether this semantics node is hidden.

onClick

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

This function adds the SemanticsActions.OnClick to the SemanticsPropertyReceiver.

Parameters
label: String? = null Optional label for this action.
action: () -> Boolean Action to be performed when the SemanticsActions.OnClick is called.
fun SemanticsPropertyReceiver.popup(): Unit

Whether this semantics node represents a Popup. Not to be confused with if this node is part of a Popup.

scrollBackward

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

Deprecated.

This function adds the SemanticsActions.ScrollBackward to the SemanticsPropertyReceiver.

Parameters
label: String? = null Optional label for this action.
action: () -> Boolean Action to be performed when the SemanticsActions.ScrollBackward is called.

scrollBy

fun SemanticsPropertyReceiver.scrollBy(
    label: String? = null,
    action: (x: Float, y: Float) -> Boolean
): Unit

This function adds the SemanticsActions.ScrollBy to the SemanticsPropertyReceiver.

Parameters
label: String? = null Optional label for this action.
action: (x: Float, y: Float) -> Boolean Action to be performed when the SemanticsActions.ScrollBy is called.

scrollForward

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

Deprecated.

This function adds the SemanticsActions.ScrollForward to the SemanticsPropertyReceiver.

Parameters
label: String? = null Optional label for this action.
action: () -> Boolean Action to be performed when the SemanticsActions.ScrollForward is called.

setProgress

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

This function adds the SemanticsActions.SetProgress to the SemanticsPropertyReceiver.

Parameters
label: String? = null Optional label for this action.
action: (Float) -> Boolean Action to be performed when the SemanticsActions.SetProgress is called.

setSelection

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

This function adds the SemanticsActions.SetSelection to the SemanticsPropertyReceiver. If this action is provided, the selection data must be provided using SemanticsProperties.TextSelectionRange.

Parameters
label: String? = null Optional label for this action.
action: (Int, Int, Boolean) -> Boolean Action to be performed when the SemanticsActions.SetSelection is called.

setText

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

This function adds the SemanticsActions.SetText to the SemanticsPropertyReceiver.

Parameters
label: String? = null Optional label for this action.
action: (AnnotatedString) -> Boolean Action to be performed when the SemanticsActions.SetText is called.

Extension properties

accessibilityLabel

var SemanticsPropertyReceiver.accessibilityLabel: String

Developer-set content description of the semantics node. If this is not set, accessibility services will present the text of this node as content part.

accessibilityValue

var SemanticsPropertyReceiver.accessibilityValue: String

Developer-set state description of the semantics node. For example: on/off. If this not set, accessibility services will derive the state from other semantics properties, like AccessibilityRangeInfo, but it is not guaranteed and the format will be decided by accessibility services.

accessibilityValueRange

var SemanticsPropertyReceiver.accessibilityValueRange: AccessibilityRangeInfo

The node is a range with current value.

customActions

var SemanticsPropertyReceiver.customActions: List<CustomAccessibilityAction>

Custom actions which are defined by app developers.

focused

var SemanticsPropertyReceiver.focused: Boolean

Whether this semantics node is focused.

testTag

var SemanticsPropertyReceiver.testTag: String

Test tag attached to this semantics node.

text

var SemanticsPropertyReceiver.text: AnnotatedString

Text of the semantics node. It must be real text instead of developer-set content description.

textSelectionRange

var SemanticsPropertyReceiver.textSelectionRange: TextRange

Text selection range for edit text.