SemanticsProperties
object SemanticsProperties
kotlin.Any | |
↳ | androidx.compose.ui.semantics.SemanticsProperties |
General semantics properties, mainly used for accessibility and testing.
Summary
Properties | |
---|---|
SemanticsPropertyKey<AccessibilityRangeInfo> |
The node is a range with current value. |
SemanticsPropertyKey<String> |
Developer-set content description of the semantics node. |
SemanticsPropertyKey<Unit> |
Whether this semantics node is disabled. |
SemanticsPropertyKey<Boolean> |
Whether this semantics node is input focused. |
SemanticsPropertyKey<Unit> |
Whether this semantics node is hidden. |
SemanticsPropertyKey<AccessibilityScrollState> |
The horizontal scroll state of this node if this node is scrollable. |
SemanticsPropertyKey<ImeAction> |
Contains the IME action provided by the node. |
SemanticsPropertyKey<Unit> |
Whether this element is a Dialog. |
SemanticsPropertyKey<Unit> |
Whether this semantics node represents a Popup. |
SemanticsPropertyKey<Role> |
The type of user interface element. |
SemanticsPropertyKey<Boolean> |
Whether this element is selected (out of a list of possible selections). |
SemanticsPropertyKey<String> |
Developer-set state description of the semantics node. |
SemanticsPropertyKey<String> |
Test tag attached to this semantics node. |
SemanticsPropertyKey<AnnotatedString> |
Text of the semantics node. |
SemanticsPropertyKey<TextRange> |
Text selection range for edit text. |
SemanticsPropertyKey<ToggleableState> |
The state of a toggleable component. |
SemanticsPropertyKey<AccessibilityScrollState> |
The vertical scroll state of this node if this node is scrollable. |
Properties
AccessibilityRangeInfo
val AccessibilityRangeInfo: SemanticsPropertyKey<AccessibilityRangeInfo>
The node is a range with current value.
ContentDescription
val ContentDescription: SemanticsPropertyKey<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.
Disabled
val Disabled: SemanticsPropertyKey<Unit>
Whether this semantics node is disabled. Note that proper SemanticsActions should still be added when this property is set.
See Also
Focused
val Focused: SemanticsPropertyKey<Boolean>
Whether this semantics node is input focused.
See Also
Hidden
val Hidden: SemanticsPropertyKey<Unit>
Whether this semantics node is hidden. A hidden node is a node that is not visible for accessibility. It will still be shown, but it will be skipped by accessibility services.
See Also
HorizontalAccessibilityScrollState
val HorizontalAccessibilityScrollState: SemanticsPropertyKey<AccessibilityScrollState>
The horizontal scroll state of this node if this node is scrollable.
ImeAction
val ImeAction: SemanticsPropertyKey<ImeAction>
Contains the IME action provided by the node.
See Also
IsDialog
val IsDialog: SemanticsPropertyKey<Unit>
Whether this element is a Dialog. Not to be confused with if this element is part of a Dialog.
IsPopup
val IsPopup: SemanticsPropertyKey<Unit>
Whether this semantics node represents a Popup. Not to be confused with if this node is part of a Popup.
See Also
Role
val Role: SemanticsPropertyKey<Role>
The type of user interface element. Accessibility services might use this to describe the element or do customizations. Most roles can be automatically resolved by the semantics properties of this element. But some elements with subtle differences need an exact role. If an exact role is not listed in Role, this property should not be set and the framework will automatically resolve it.
See Also
Selected
val Selected: SemanticsPropertyKey<Boolean>
Whether this element is selected (out of a list of possible selections). The presence of this property indicates that the element is selectable.
See Also
StateDescription
val StateDescription: SemanticsPropertyKey<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.
TestTag
val TestTag: SemanticsPropertyKey<String>
Test tag attached to this semantics node.
See Also
Text
val Text: SemanticsPropertyKey<AnnotatedString>
Text of the semantics node. It must be the actual text displayed by this component instead of developer-set content description.
See Also
TextSelectionRange
val TextSelectionRange: SemanticsPropertyKey<TextRange>
Text selection range for edit text.
ToggleableState
val ToggleableState: SemanticsPropertyKey<ToggleableState>
The state of a toggleable component. The presence of this property indicates that the element is toggleable.
VerticalAccessibilityScrollState
val VerticalAccessibilityScrollState: SemanticsPropertyKey<AccessibilityScrollState>
The vertical scroll state of this node if this node is scrollable.