When an Activity comes to the foreground, TalkBack announces it’s title. When the activity has no title, TalkBack announces the name of the application which might confuse the user -> set a title to all visible activities, either in AndroidManifest
or using Activity.setTitle()
method.
-
Illustrative images such as
ImageView
's should haveimportantForAccessibility
set to “no” ->android:importantForAccessibility="no"
. -
Buttons such as
ImageButton
's with labels should havecontentDescription
set to null. Setting importanceForAccessibility to “no” makes them unfocusable in the accessibility mode. -
ImageButton
s without text labels must set a validcontentDescription
. Exclude the element type from thecontentDescription
.- Most accessibility services, such as TalkBack and BrailleBack, automatically announce an elements type after announcing its label.
Example: The background image on the login prologue screen (below) does not require additional context because the text announces the intent of the view. The same is true of the JetPack login button.
-
When a UI element is just a label for another element, set the
labelFor
attribute. -
When labeling editable elements, such as
EditText
objects, use theandroid:hint
XML attribute for static elements andsetHint()
for dynamic elements.
- If users should treat a set of elements as a single unit of information, you can group these elements in a focusable container (use android:focusable=”true”).
Example: The email note to customer component was specifically built to better communicate the purpose of this settings by using a focusable container
- Make sure that custom views are accessible with both Switch Access and TalkBack. Learn more about both of these accessibility features in the Android developer docs. Consider implementing accessibility functionality for them using ExploreByTouchHelper.