January 2017
Beginner to intermediate
624 pages
22h 42m
English
Now, update the buttons in BeatBox with a style. A style is a set of attributes that you can apply to a widget.
Navigate to res/values/styles.xml and add a style named BeatBoxButton. (When you created BeatBox, your new project should have come with a built-in styles.xml file. If your project did not, create the file.)
Listing 22.2 Adding a style (res/values/styles.xml)
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="BeatBoxButton">
<item name="android:background">@color/dark_blue</item>
</style> </resources> ...Read now
Unlock full access