Android: control programmatically control "talkback" focus

2,982 views
Skip to first unread message

Daniele Segato

unread,
Oct 17, 2018, 6:49:06 AM10/17/18
to Eyes-free Programming and development
I'm cross-posting this from https://groups.google.com/forum/#!topic/eyes-free/a6N9EU1peRQ

I discovered this forum dedicated to developers after the other.

This is not exactly like my first message there, I edited adding information that was present in the responses:



Hi,

I'm trying to make the App I developed for a customer accessible and I'm encountering some difficulties.
It's a local transit app, the main section is google map with points of interests (markers) on it.

I'd post a picture but I figured here it's better to describe.

On top there's a classic toolbar with navigation drawer (hamburger menu) --- login / contacts / settings etc....
On bottom there's a bottom bar navigation that handle the main sections navigations.

The main feature is the map and it has a button to start a "give me direction" mode that let the user pick a destination and compute a path using local transit.

Min SDK 21 (Lollipop)

I've released the app with some fixes and I'd like to improve it, but I'm struggling on some technical issue.


1) Navigation within the same screen

When the user click (or double-tap activate) a marker on the map a new view pop up in front of the map showing more details of the selected marker. It is actually a fragment.
The new view also is clickable to enter the full detail.

I can't find a way to move the focus on that view so that the TalkBack read to the user the details of the marker and tells him that he can activate.
When the user press the back button the overlay view closes, should I tell something to the user here? how?


I've experimented with:
  • requestFocus() on the new view --> no effect
  • mark the new view as accessibilityLiveRegion: this makes TalkBack read the new content but doesn't focus it

The Google Play app does exactly what I want to do:
  1. Open Google Play App (and activate talkback if you didn't yet)
  2. Activate (double tap) the side menu / home button (hamburger menu)
When you do that the drawer open and talkback announce the panel has been opened and move the selection to the current user announcing it.

This is the behavior I want to reproduce but I can't find how.


2) Control focus order

As I described above my app main navigation is bottom. On the top, just below the toolbar, there's a big button (wide as the screen) to trigger the direction feature with label "where do you want to go?"

Technically I've an Activity containing the toolbar, drawer menu, and bottom navigation.

A fragment is used to switch sections in the middle (this open the main map section).


Using the linear exploration the focus goes like this:

  1. Actionbar Toolbar (this is fine)
  2. map + all the markers (they can be many)
  3. my location button (from map)
  4. direction feature button
  5. bottom navigation sections
Now, I think the order should be very different then this.

Something like:
  1. Actionbar Toolbar (this is fine)
  2. direction feature button
  3. bottom navigation section
  4. my location button (from map)
  5. map + all the markers (they can be many)

but I can't control this at all.

I tried with focusForward on the top level (AppBarLayout -> BottomNavigation) and accessibilityTraversalAfter.

I've managed to make the focus on the "direction feature" button be focused before the map by adding 

        android:accessibilityTraversalBefore="@+id/mapFragment"

but no way to jump to the bottom navigation and back to the map after that (maybe I'm not supposed to...)

I would like the focus to jump across technical boundaries: from the actionbar in the main activity to a specific button inside a fragment that is dynamically loaded, then back to the activity on the bottom navigation bar, then back inside the fragment.


I've really no idea how to handle this and it feels like this will give a poor experience to visual impaired users.


3) Control complex scrolling like the Bottom Panel

Inside the direction features the directions results are presented in a map that shows to the user the path with each step in a different color, this is drawn on the map.
A bottom panel contains the same information as a list that is scrollable.
The bottom panel start docked: it only show basic information like the trip duration, cost etc.

When I try to navigate it with talkback it skip all the map drawing since they have no title / snipped (the user still hear them being traversed) and jump to the bottom panel.
But there's no indication for the user that that panel is scrollable and contains many items.

The text list also contains directions like "Walk for 800 meters south along XYZ street". But sometimes has information that aren't shown on the map because they are a step for the user but they do not imply a specific movement.


For this I tough about moving the header of the bottom panel inside the recyclerview and add some "dummy" non visible view that tell the user there's an expandable panel there, or try to detect talkback is active and expand the panel right away or even load a completely different UI that only has the list.

I'm at a loss here too.



I really hope you can help, I DO want to make the app accessible but the documentation didn't help when I had more complex situations like the ones I described here.

Hope you can help
thanks,
Daniele

Eitan Isaacson

unread,
Nov 29, 2018, 1:38:38 PM11/29/18
to eyes-f...@googlegroups.com
Hey! Didn't read your entire message, but I thought I would try to answer anyway :)

You can manipulate which view has talkback focus by dispatching a TYPE_VIEW_ACCESSIBILITY_FOCUSED event. You may also need to have a custom node provider where you can manipulate accessibility focused state, and override findFocus.

--
You received this message because you are subscribed to the Google Groups "Eyes-free Programming and development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eyes-free-de...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages