Android Programming: The Big Nerd Ranch Guide, 2nd Edition
by Bill Phillips, Chris Stewart, Brian Hardy, Kristin Marsicano
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access