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.