Navigate between headings with swipe while using talkback
Asked Answered
W

3

7

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.

Wabble answered 4/10, 2018 at 8:55 Comment(2)
any update on this. I am also facing same issue.Dispend
It works exactly how you said it should work on my device (Mi Mix 2)Andrej
A
3

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.

Andrej answered 21/6, 2021 at 11:40 Comment(0)
T
2

I was having the same issue. In my particular situation it was fixed when I set focusable and focusableInTouchMode to false in the parent view, and true in the TextView.

Trillium answered 1/10, 2019 at 14:26 Comment(0)
R
1

I just tried, it work here as expected. Talkback properly announces textviews as headings and in heading mode I can navigate to them as well. Please ensure that you are using the latest version of Talkback. This is quite an old question so may be you may have got the solution since then

Reni answered 26/7, 2019 at 17:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.