Created
July 21, 2023 13:17
-
-
Save dladukedev/b360e53e1adeef7f049d068a6d9f290c to your computer and use it in GitHub Desktop.
Overview of how TalkBack interprets Different Semantic Modifiers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Reads "One" -> "Two" -> "Three" | |
Row(modifier = Modifier.semantics(mergeDescendants = false) { }) { | |
Text("One") | |
Column { | |
Text("Two") | |
Text("Three") | |
} | |
} | |
// Reads "One Two Three" | |
Row(modifier = Modifier.semantics(mergeDescendants = true) { }) { | |
Text("One") | |
Column { | |
Text("Two") | |
Text("Three") | |
} | |
} | |
// Reads "One" -> "Two Three" | |
Row(modifier = Modifier.semantics(mergeDescendants = true) { }) { | |
Text("One") | |
Column(modifier = Modifier.semantics(mergeDescendants = true) { }) { | |
Text("Two") | |
Text("Three") | |
} | |
} | |
// Reads "Custom Description One Two Three" | |
Row(modifier = Modifier.semantics(mergeDescendants = true) { | |
contentDescription = "Custom Description" | |
}) { | |
Text("One") | |
Column { | |
Text("Two") | |
Text("Three") | |
} | |
} | |
// Reads "Custom Description" | |
Row(modifier = Modifier.clearAndSetSemantics { | |
contentDescription = "Custom Description" | |
}) { | |
Text("One") | |
Column { | |
Text("Two") | |
Text("Three") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment