17

How can I change the default Text content description to be read on TalkBack on Jetpack Compose to any text that I want ?

Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
julioribeiro
  • 1,565
  • 2
  • 14
  • 22

1 Answers1

26

As described in the accessibility documentation you can use the semantics modifier.
You can use the contentDescription semantic property to set a custom content description:

Text("First text", modifier = Modifier.semantics {
    this.contentDescription = "Custom content description" }
)
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841