Android backibility for fragment recall

Is there a way to get the Talkback feature in Android availability to say something after a fragment transaction? I basically want talkback to say the name / title of the fragment after the switch. These headers are set as action bar headers, can I get them there? The user can drag his finger over the text on the action bar to find out which screen they are on, but the user will not know this if they were not already familiar with the application.

+6
source share
1 answer

You can force the WINDOW_STATE_CHANGED event from the decor view to declare an ActionBar header. This will also cause TalkBack clear the focus of accessibility, so you should only call it when the main content of the application changes.

 getWindow().getDecorView() .sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED); 
+9
source

Source: https://habr.com/ru/post/958099/


All Articles