Android Programming The Big Nerd Ranch Guide by Bill Phillips, Chris Stewart, Kristin Marsicano (z-lib.org)

(gtxtreme123) #1

Chapter 19  Accessibility


Making Non-Text Elements Readable by TalkBack


Now, press the new crime button in the toolbar. This gives accessibility focus to the new crime option,
and TalkBack announces the button’s name and options again. With the new crime button selected,
double-tap anywhere on the screen to launch the crime details screen.


Adding content descriptions


On the crime details screen, press the image capture button to give it accessibility focus (Figure 19.6).
TalkBack announces, “Button unlabeled. Double-tap to activate.” (You may get slightly different
results depending on the version of Android you are using.)


Figure 19.6  Image capture button selected


The camera button does not display any text, so TalkBack describes the button as well as it can. While
this is TalkBack’s best effort, the information is not very helpful to a user with a vision impairment.


Luckily, this problem is very easy to fix. You are going to specify details for TalkBack to read by
adding a content description to the ImageButton. A content description is a piece of text that describes
the widget and is read by TalkBack. (While you are at it, you are going to add a content description for
the ImageView that displays the selected picture, too.)

Free download pdf