1

Hi I have a view with a TextView and linear layout. Linear layout is a kind of custom keyboard with number of buttons. So every button click I have to do some validations and append a character to the TextView.

Click of each button I append the character to the textview. Now when I turn the Accessibility feature ON, it is expected to read out the last character that is entered. But what happens is every time I set text in the text view.. Accesibilty feature reads out the 1st char in the textview, not the last char.. so Im confused on how to control the accessiblity of textview.. Can anyone plz tell me how to control the accessibilty.

rds
  • 26,253
  • 19
  • 107
  • 134
Pocoyo
  • 55
  • 1
  • 3
  • 8

2 Answers2

3

You could use the setContentDescription() on your TextView to set it to the character you just entered. Then when accessibility kicks in it will ask your TextView for its content description and it should work. See docs here:

https://developer.android.com/reference/android/view/View.html#setContentDescription(java.lang.CharSequence)

chopchop
  • 1,905
  • 2
  • 22
  • 37
  • 2
    This is especially true for views that do not have textual representation.. and it happens too.. Im setting the content description.. Devices reads only the values that I set the text not the contentDesrciption.. I think setContentDesc.. is for views like ImageButtons.... – Pocoyo Feb 20 '13 at 14:25
0

Apply below line in your TextView pallet

tools:ignore="TextSizeCheck"