1

I am wondering why Android doesn't support this.

To explain my problem. I am working on an accessibility feature for an Android app.

I have a TextView that displays a number value like 123456.

If I use TalkBack, it will always read just this number value.

What I want it to give this value a context so that TalkBack would read something like: "Number value 123456" I am not able to do that as contentDescription just overrides the text value and hint attribute is read after the value like: "123456 Number value".

Is there an alternative for this? Let me also say that the app is not using a separate TextView which would say "Number value" that TalkBack could read.

John Doe
  • 131
  • 10
  • 1
    What do you mean `contentDescription` overrides the text value? If so surely this is what you want? Then you can set the `contentDescription` to 123456 Number value? – Henry Twist Mar 12 '21 at 11:54
  • The value in my example is dynamic and not always 123456. If it would be the same all the time I could do contentDescription="Number value 123456" – John Doe Mar 12 '21 at 12:00
  • Unless it's possible to read the text value and add it in the contentDescription in XML? – John Doe Mar 12 '21 at 12:00
  • Well not in XML unless you're using data binding? But otherwise I can post a programmatic solution? – Henry Twist Mar 12 '21 at 12:14
  • Why doesn't the text view have the information within it that provides the context in the first place? – GrahamTheDev Mar 12 '21 at 12:17
  • Does this answer your question? [Android Acccessibility: How do I change the text read out loud for an EditText View](https://stackoverflow.com/questions/25641081/android-acccessibility-how-do-i-change-the-text-read-out-loud-for-an-edittext-v) – Daniel Mar 12 '21 at 14:31

1 Answers1

1

The solution I did was to use

var number = 123456
textView.contentDescription = "Number value ${number}"
John Doe
  • 131
  • 10