188 CHAPTER 6: Android Screen Design: Writing to the Display Using Activity and View
Figure 6-20. Problems with dark text and parent layout_margin parameter (left); fixed (center) and refined (right)
Contrast is one of those graphics terms that we normally would save for Chapter 9 on graphic
design for Android, but let’s cover it here since we are encountering this problem now! Contrast
is how much difference between light and dark there is in an image, and with text or UI widgets
especially, influences how visible they are to a user (that is, how much they “pop” out, in the case of
UI widgets, or are easy to read, in the case of text).
Maximum contrast would be achieved by using a black text color on a white background color, or
a white text color on a black background color, while a minimum contrast scenario would involve a
medium gray text color on a medium gray background color. The minimum contrast scenario would
appear as though the medium gray background color was the only thing on the screen, as there is
zero contrast between the medium gray text and medium gray background.
Let’s fix this next by adding the android:textColor parameter to the
can crank the contrast back up near maximum, and make the UI readable again for our
application users!
After we learn how to control the
the
If you want to peek at the result of the next two sections of this chapter, where you’ll learn about
android:textColor and nesting LinearLayout containers, you can also see this in Figure 6-20.