Adding Theme Colors

With the base theme squared away, it is time to customize the attributes of BeatBox’s AppTheme.

In the styles.xml file, you will see three attributes. Update them to match Listing 21.7.

Listing 21.7  Setting theme attributes (res/values/styles.xml)

<style name="AppTheme" parent="Theme.AppCompat">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimaryred</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDarkdark_red</item>
    <item name="colorAccent">@color/colorAccentgray</item>

These theme attributes look similar to the style attributes that you set up earlier, but they specify different properties. Style attributes specify properties for an individual widget, ...

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.