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>
</style>

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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.