Android Programming The Big Nerd Ranch Guide, 3rd Edition
For the More Curious: Espresso and Integration Testing 417 You may wonder why you would not retain every fragment or why fragmen ...
Chapter 21 Unit Testing and Audio Playback 418 A couple of annotations get this code up and running. The @RunWith(AndroidJUnit4 ...
Challenge: Playback Speed Control 419 Challenge: Playback Speed Control In this challenge, you will add playback speed control t ...
...
421 22. Styles and Themes Now that BeatBox sounds intimidating, it is time to make it look intimidating, too. So far, BeatBox st ...
Chapter 22 Styles and Themes 422 Color Resources Begin by defining a few colors that you will use throughout the chapter. Edit ...
Styles 423 Listing 22.3 Using a style (res/layout/list_item_sound.xml) <Button style="@style/BeatBoxButton" android:layout_w ...
Chapter 22 Styles and Themes 424 Style inheritance Styles also support inheritance: A style can inherit and override attributes ...
Themes 425 Run BeatBox and verify that your button text is indeed bold, as in Figure 22.3. Figure 22.3 A bolder BeatBox Themes ...
Chapter 22 Styles and Themes 426 Modifying the theme When you created BeatBox, it was given a default theme. Navigate to Androi ...
Modifying the theme 427 Theme.AppCompat.Light.DarkActionBar – a light theme with a dark toolbar Change the parent theme to The ...
Chapter 22 Styles and Themes 428 Adding Theme Colors With the base theme squared away, it is time to customize the attributes o ...
Overriding Theme Attributes 429 You will not see the colorAccent attribute affect BeatBox because Buttons do not support tinting ...
Chapter 22 Styles and Themes 430 Command-click on Base.Theme.AppCompat. Android Studio will tell you that this theme is resourc ...
Theme spelunking 431 AppCompat library, you do it directly. You would just write Theme.AppCompat, because those files exist in y ...
Chapter 22 Styles and Themes 432 Run BeatBox, scroll down to the bottom of your recycler view, and verify that the background ( ...
Modifying Button Attributes 433 Modifying Button Attributes Earlier you customized the buttons in BeatBox by manually setting a ...
Chapter 22 Styles and Themes 434 Duplicate what happens in Android’s own theme in BeatBox. Change the parent of BeatBoxButton t ...
For the More Curious: More on Style Inheritance 435 You are now overriding the buttonStyle attribute and substituting your own s ...
Chapter 22 Styles and Themes 436 Specifying the parent theme in the theme name only works for themes that exist in the same pac ...
«
18
19
20
21
22
23
24
25
26
27
»
Free download pdf