For accessibility I'm trying to traverse through a (nested) RecyclerView
, using Talkback.
However, instead of scrolling all the way to the bottom of the screen (vertically), the swipe of the horizontal RecyclerView
is triggered. As a result, it is not possible to traverse all the way to the bottom.
The view looks like this:
<SwipeRefreshLayout>
<...>
<NestedScrollView>
<RecyclerView orientation=horizontal>
<!-- This is for every view of the horizontal RecyclerView -->
<CardView>
<RecyclerView orientation=vertical>
</RecyclerView>
</CardView>
<!-- Till here -->
</RecyclerView>
</NestedScrollView>
</SwipeRefreshLayout>
More detailed explanation of the problem:
- Start with Talkback on and the first view is selected.
- The horizontal
RecyclerView
contains multiple items which are loaded in the background. - The vertical
RecyclerView
contains items that exceed the screen when it is first loaded. So lets say you see 10 items, but there are 20 in the vertical list. - You start swiping through the items with Talkback and are almost at the 10th item of the vertical
RecyclerView
. - So you swipe once more and you are on the 10th item, which is the last view that is currently visible.
- The next swipe will result in going to the next view of the horizontal
RecyclerView
. However, it should continue scrolling to the next view in the verticalRecyclerView
....
How I understand it, is that going to the next view of the horizontal RecyclerView
can be done by using to fingers as real swipe of the app. The two finger swipe is explained here.
What I tried:
- Use the
android:focusableInTouchMode
andandroid:descendantFocusability
to improve the traversal order, as advised here. - Set the
android:importantForAccessbility
tofalse
on the horizontalRecyclerView
items that are not visible at that moment. Note that it is hard to decide whether this was sufficient because the views are rather complex. - Play with
accessibilityTraversalAfter
enaccessibilityTraversalBefore
to improve the traversal order.
The question is, how can I make ensure that Talkback traverses to the end of the screen? In other words; that traversing with Talkback does not trigger going to the next item in the horizontal recycler?