Chapter 19 Accessibility
The ImageView, EditText, and CheckBox have outlines around them. This indicates that the scanner
found potential accessibility problems with those widgets. Press on the EditText to view accessibility
suggestions for that widget (Figure 19.13).
Figure 19.13 Accessibility Scanner EditText recommendations
Accessibility Scanner has three suggestions. The first relates to the size of the EditText. The
recommended minimum size for all touch targets is 48dp. The EditText’s height is smaller, which you
can easily fix by specifying an android:minHeight attribute for the widget.
The second issue relates to its label. The scanner points out that the information provided by the title
TextView and the EditText may be redundant, since the EditText refers to the TextView. However,
redundancy is not a problem here, so you can ignore this recommendation.
The final suggestion is about the contrast between the text color and its background color. There are
tools available online to estimate the contrast ratio of two colors based on their luminosity. There
are also sites, like randoma11y.com, that list color combinations that meet accessibility standards for
contrast. What are those standards? The World Wide Web Consortium, an international community that
develops open standards for web design, recommends a ratio of at least 4.5:1 for text that is 18 point
or smaller. The ratio of the colors in CriminalIntent’s EditText is 3.52. To fix this, you can adjust the
values of its android:textColor and android:background attributes.
You can learn more about each of Accessibility Scanner’s recommendations by pressing the down
arrow to drill into the details and then pressing Learn More.