Challenge: An Appropriate Base Theme

When you created BeatBoxButton, you inherited attributes from android:style/Widget.Holo.Button. While inheriting from the Holo theme works, you are not taking advantage of the latest theme available.

In Android 5.0 (Lollipop), the material theme was released. This theme makes changes to various properties of your button, including the font size. It is a good idea to take advantage of this new look on a device that supports the material theme.

Your challenge is to create a resource-qualified version of your styles.xml file: values-v21/styles.xml. Next, create two versions of your BeatBoxButton style. One should inherit attributes from Widget.Holo.Button, and the other from Widget.Material.Button ...

Get Android Programming: The Big Nerd Ranch Guide, 2nd 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.