Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Navigate between headings with swipe while using talkback

Android 9 has introduced accessibilityHeading tag, which can be used by talkback to announce the Headings.

https://developer.android.com/about/versions/pie/android-9.0#a11y

Look for Heading-based navigation

In my app I have multiple Textviews in my activity with some Headings

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="10dp"
            android:accessibilityHeading="true"
            android:text="Accessibility Heading 1"
            android:textColor="#000000"
            android:textSize="18sp" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="20dp"
            android:text="Message"
            android:textColor="#000000" />

But when I run the app, headings are treated as normal textviews only and no special treatment is given by Talkback.

I can swipe left to navigate through all elements. There is option to swipe up to change mode for talkback announcements. e.g Default, Links, Controls, Headings etc.

When chosen Headings, I expect talkback to announce only headings and to jump from one heading to another but it stays at the same place even after Swipe Left or Swipe Right gesture.

like image 476
Shashank Degloorkar Avatar asked Oct 04 '18 08:10

Shashank Degloorkar


People also ask

How do I swipe in TalkBack mode on Android?

To open the TalkBack menu, swipe down then right, or swipe up then right. Or on devices with multi-finger gestures*, you can also do a three-finger tap. Reading controls: allow adjustment of reading settings, such as being able to swipe to read by headings or by lines, and to change the speech rate.

How do you slide on TalkBack?

To do a headfirst slide, run full speed, then lean forward and dive horizontally, landing on the heels of your hands and your chest. Keep your palms down but your fingers off the ground to avoid crushing them into the base. Dig the toes of your shoes into the dirt if you need to stop the slide.


1 Answers

Set both accessibilityHeading and focusableInTouchMode to true. Then, after setting the navigation mode to Headers (you can do this via the up down gesture), swiping up or down navigates you though the headers. Swiping right and left will still allow you to navigate through single items.

like image 68
Cristan Avatar answered Sep 30 '22 04:09

Cristan