5

short version: navigating into a RecyclerView with TalkBack gestures forces you to swipe through every item before you can move on, is that normal? Is there a standard way to navigate out and onto the next element?

I'm trying to get accessibility features working smoothly in an app I'm working on, but I've run into a problem with part of the UI. I'm using RecyclerViews sized so you can only see one item at a time, snapping to the centre, so you can swipe to change the current value from a range. It's basically the NumberPicker approach but directly in the UI, instead of a separate dialog.

The issue is by doing swipe gestures (Default linear navigation) through the UI, as soon as it lands on the RecyclerView, it starts on the current item and then navigates through every single item in the list. It won't exit the RecyclerView until it's hit the last item and has nowhere else to go.

My question is, is this normal? I'm new to TalkBack and I can't find much info on what's expected in every situation. I know my situation is a little unusual (since navigating the RecyclerView implicitly means changing the current item) but just being trapped inside the list until you go through every item seems a really strange way to navigate in general.

I know there are solutions like adding navigation headings etc (which is how the Play Store seems to handle this with their "infinite" horizontally scrolling app selections) but I just wanted to check I wasn't missing something. TalkBack announces "in list" and "out of list" when you tap on/outside of the RecyclerView, so it seems like there should be a way to explicitly navigate in and out with a gesture too...? Would users be used to switching to Controls or Headings navigations to do this?

Thanks! I really want to make this work for everyone but it's hard to know if I've done something wrong, or if I'm just bumping into limitations with the standard components

cactustictacs
  • 17,935
  • 2
  • 14
  • 25
  • Any solutions to this problem yet? I am running into the same issue. – Rik van Velzen Sep 14 '21 at 12:43
  • @RikvanVelzen sorry, I haven't really found a solution, and I haven't dug into it with the accessibility libraries. I think the problem is the with linear navigation, you only really have two things you can do - go forward, or go back. The way Switch Access handles it, is you navigate *onto* the `RecyclerView`, and then you get an option to go *into* it (which means you also get to back out). But TalkBack just dives straight in, so the list items just look like part of a flat hierachy – cactustictacs Sep 14 '21 at 16:26
  • 1
    You might be able to do something with an ``AccessibilityDelegate``, find a way to override the ``RecyclerView``'s normal handling and make a click event give it focus, but I've not had a lot of luck poking at its internals. And I'm kinda leery of messing with the way accessibility works in case it breaks for some other case - since Switch Access handles it differently, who knows what could happen? Probably the safest thing is to check if accessibility services are enabled, and replace it with a ``TextView`` that pops up a dialog with the list in it... – cactustictacs Sep 14 '21 at 16:35

0 Answers0