July 2015
Beginner to intermediate
600 pages
18h 59m
English
Earlier you customized the buttons in BeatBox by manually setting a style attribute in the res/layout/list_item_sound.xml file. If you have a more complex app, with buttons throughout many fragments, setting a style attribute on each and every button does not scale well. You can take your theme a step further by defining a style in your theme for every button in your app.
Before adding a button style to your theme, remove the style attribute from your res/layout/list_item_sound.xml file.
Listing 20.11 Be gone! We have a better way (res/layout/list_item_sound.xml)
<Button xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"style="@style/BeatBoxButton.Strong" ...
Read now
Unlock full access