pub enum SemanticsWidgetRole {
Button,
Checkbox,
Switch,
RadioButton,
Tab,
Image,
Header,
}Expand description
What kind of control a node is, as screen readers announce it.
This is Compose’s SemanticsProperties.Role (Modifier.semantics { role = Role.RadioButton }), not a description of where the node sits in the tree.
A screen reader turns it into the trailing noun it speaks after the label —
TalkBack says “CAMPAIGN, radio button, selected” — and into the on/off
wording it uses for a switch. Compose keeps this separate from the node’s
structural kind for the same reason Cranpose does: a Row that happens to
be clickable is still a row, and a drawn ring segment that is a radio button
has no layout node of its own at all.
Variants§
Button
Checkbox
Switch
RadioButton
Tab
Image
Header
Compose’s heading(), which is a property rather than a Role, but
reaches the platform through the same field on every backend Cranpose
targets (AccessibilityNodeInfo.setHeading, Role::Heading,
<h*>/UIAccessibilityTraitHeader).
Trait Implementations§
Source§impl Clone for SemanticsWidgetRole
impl Clone for SemanticsWidgetRole
Source§fn clone(&self) -> SemanticsWidgetRole
fn clone(&self) -> SemanticsWidgetRole
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more