Unexposed text

Accessibility services users often rely on content labels to get information and find and activate controls. But excessive or incorrect specification of labels can confuse users with overly wordy announcements. 

Screen readers usually announce text that is displayed on the screen. However, developers may need to provide accessibility labels in some situations where accessibility services don’t get information that is presented visually, like a graphic that isn’t purely decorative. In other situations, developers may specify accessibility labels to override a screen reader's default announcement, like to indicate context otherwise provided by the visual layout.

When speech input users, like Voice Access users, interact with a control, they usually speak the visible text on the screen. To give similar user experiences for screen reader users and other users, when a control is given an accessibility label, it's recommended that it start with the visible label in its entirety. It also improves navigation when speech-input users can speak the visible text on the screen, because they don't need to memorize different speech commands.

Implementation

  • Visible text in a user interface component should be available to accessibility services.
  • The programmatic accessibility label of a user interface component should match the corresponding text that is visible to users.

Good examples:

  • A button with visible “got it” text is labeled as “got it.”
  • A ViewGroup that represents a list row is labeled with a contentDescription that customizes the ordering descendant TextViews. The contentDescription contains all text visible within that list row so screen readers can communicate a representation of the text visible within the row.

Bad examples:

  • The programmatic accessibility label doesn’t match the visible text. A button with the word “Delete” uses the word “Remove” instead of “Delete” in its accessibility label.
  • The programmatic accessibility label is partially visible. A button with the visible text “Log in with username” uses “Log in” as its accessibility label.
  • The words contained in the programmatic accessibility label aren't in the same order as they're presented visibly on the screen. For example, if the visible text on the screen says "Add to favorites," the accessibility label shouldn't be "favorites to add" or "add to my favorites." A sighted person who uses a screen reader, like sighted people who use TalkBack, may have extra cognitive load to understand the screen reader that doesn’t match the visible text.
  • A ViewGroup that represents a list row is labeled with a contentDescription that doesn’t contain all text visible within that list row.

Design

  • Visible text in a user interface component should be available to accessibility services.
  • The programmatic accessibility label of a user interface component should match or contain its corresponding text visible to users.
  • Text labels should be used to present text information, not text within images.

Testing

  1. To test for labels on Android, turn on TalkBack.
  2. Explore the screen and navigate to each control.
  3. Take note of what the screen reader announces.  
    • Confirm that the visible text of the UI component has been announced by the screen reader.
    • Confirm that the words announced by the screen reader (the programmatic label) include all visible text of the UI component.

Tip: To do a manual test of your device, go to Accessibility Scanner for Android.

Search
Clear search
Close search
Main menu
14751410878784284283
true
Search Help Center
true
true
true
true
true
717068
false
false