Color Resources

Begin by defining a few colors that you will use throughout this chapter. Edit your res/values/colors.xml file to match Listing 21.1.

Listing 21.1  Defining a few colors (res/values/colors.xml)

<resources>
    <color name="colorPrimary">#008577</color>
    <color name="colorPrimaryDark">#00574B</color>
    <color name="colorAccent">#D81B60</color>

    <color name="red">#F44336</color>
    <color name="dark_red">#C3352B</color>
    <color name="gray">#607D8B</color>
    <color name="soothing_blue">#0083BF</color>
    <color name="dark_blue">#005A8A</color>
</resources>

Color resources are a convenient way to specify color values in one place that you reference throughout your application.

Get Android Programming: The Big Nerd Ranch Guide, 4th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.