In some devices (nexus) when we tap on the first item in listview it will talkback as list item + " in list of X item". How can we remove the text " in list of X item"?
Please share your thought
Thanks in Advance
In some devices (nexus) when we tap on the first item in listview it will talkback as list item + " in list of X item". How can we remove the text " in list of X item"?
Please share your thought
Thanks in Advance
The way to control effectively how talkback behaves is to add content description on you views which should be described to the user:
Java
view.setContentDescription("Your text here");
XML
android:contentDescription="Your text here"
and views that have no meaning to someone using talkback set :
JAVA
view.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
XML
android:importantForAccessibility="no"
There are several options:
auto
noHideDescendants
yes
no
Please note that you can control view groups that way also.
Play with it a little.
I found a solution where you set weather the (RecyclerView or ListView) should be important for Accessibility directly.
If you set it to individual views items in the list, Talkback will still announce "x items" the first time that list gets created.
In Kotlin: "dataBinding.customRecyclerView.importantForAccessibility = View.IMPORTANT_FOR_ACCESSIBILITY_NO