Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Recyclerview Talkback issue

I have an Android Recyclerview which has some more rows of item.

In the sense Recyclerview comprises of
Row 1 ->> TextView , below that one more textview

Row 2 ->> TextView , below that one more textview

Issue is that, whenever I turn on the Talkback, it reads out the entire Recyclerview in one go, which is not expected, it should read one item at a time depending on the focussed item.

Expected behavior is - Read component on Focus when d-pad is moved onto it.

Any help??

like image 509
akash89 Avatar asked Apr 08 '16 07:04

akash89


People also ask

How do I stop accessibility from announcing Android button as button?

Try to uncheck the setting in TalkBack -> verbosity -> speak element type -> uncheck. Now talkback will not announce class type of view at end of content description. Save this answer. Show activity on this post.

How do I know if TalkBack is enabled Android?

More details: if you are strictly interested in whether TalkBack is enabled, use am. isTouchExplorationEnabled() . (If Select to Speak is enabled and TalkBack disabled, am. isEnabled() will still return true.)

What is Android importantForAccessibility?

Android defines android:importantForAccessibility as: Describes whether or not this view is important for accessibility. If it is important, the view fires accessibility events and is reported to accessibility services that query the screen.

How do you use announceForAccessibility?

For this you can use the method announceForAccessibility() on a view. When announceForAccessibility() is called, Android will give an audible announcement for those using a screen reader, and do nothing if an accessibility tool is not in use. You can use this to inform the user that the value has been incremented.


2 Answers

Contrary to ChrisCM's answer, you should NOT set...

android:importantForAccessibility="no"

... on your RecyclerView. This will disable all native accessibility functionality related to your list, including the ACTION_SCROLL_FORWARD / ACTION_SCROLL_BACKWARD actions (Accessibility Source), and the ability to append "In List" / "Out of List" context to accessibility announcements.

Instead, you should set...

android:focusable="true"
android:focusableInTouchMode="true"

...on the root layout of your List items, which will enable them to gain focus individually when the accessibility user navigates to them.

like image 54
AlgoRyan Avatar answered Sep 20 '22 01:09

AlgoRyan


It would appear that at some point in the construction process your Recycler View is marked as importantForAccessibility. When a container view is marked as important for accessibility it gathers all of the information within that container and announces it as the content description.

This should remedy the situation.

android:importantForAccessibility="no" //Or "auto"

If at no point in code did you set this otherwise, this would appear to be a bug with your flavor of Android. This is certainly not desirable default behavior.

Edit:

Changed "no" to "auto". Really we just want it to not be "yes", which is the value that creates the poor behavior. Auto behaves better with Switch Control on modern devices.

Been investigating this on and off for a bit, I don't think there's a Android OS Version agnostic solution here. Android APIs have changed their definition of Focusability vs Accessibility Focusability too many times across too many versions.

like image 26
ChrisCM Avatar answered Sep 17 '22 01:09

ChrisCM