Android Programming The Big Nerd Ranch Guide, 3rd Edition
437 23. XML Drawables Now that BeatBox has been themed, it is time to do something about those buttons. Currently, the buttons d ...
Chapter 23 XML Drawables 438 Making Uniform Buttons Before creating any XML drawables, modify list_item_sound.xml. Listing 23.1 ...
Shape Drawables 439 Figure 23.2 Spaced-out buttons Shape Drawables Now, make your buttons round with a ShapeDrawable. Since XML ...
Chapter 23 XML Drawables 440 Apply button_beat_box_normal as the background for your buttons. Listing 23.3 Modifying the backg ...
State List Drawables 441 State List Drawables To fix this, first define a new shape drawable that will be used for the pressed s ...
Chapter 23 XML Drawables 442 Run BeatBox and press a button. The button’s background changes (Figure 23.4). Pretty slick, right ...
Layer List Drawables 443 Layer List Drawables BeatBox is looking good. You now have round buttons and they visually respond to p ...
Chapter 23 XML Drawables 444 Run BeatBox and press on a button or two. You will see a nice ring around the pressed interface (F ...
For the More Curious: Mipmap Images 445 For the More Curious: Mipmap Images Resource qualifiers and drawables are handy. When yo ...
Chapter 23 XML Drawables 446 For the More Curious: 9-Patch Images Sometimes (or maybe often), you will fall back to regular old ...
For the More Curious: 9-Patch Images 447 In the solutions for this chapter (see the section called Adding an Icon in Chapter 2), ...
Chapter 23 XML Drawables 448 Why are they called 9-patches? A 9-patch breaks your image into a three-by-three grid – a grid wit ...
For the More Curious: 9-Patch Images 449 In the 9-patch editor, first check the Show patches option to make your patches more vi ...
Chapter 23 XML Drawables 450 Repeat the process with the pressed version. Run BeatBox to see your new 9-patch image in action ( ...
For the More Curious: 9-Patch Images 451 Use the content area to center the text within the buttons. Go back to ic_button_beat_b ...
Chapter 23 XML Drawables 452 Run BeatBox to see your nicely centered text (Figure 23.13). Figure 23.13 New and more improved T ...
453 24. More About Intents and Tasks In this chapter, you will use implicit intents to create a launcher app to replace Android’ ...
Chapter 24 More About Intents and Tasks 454 Setting Up NerdLauncher Create a new Android application project named NerdLauncher ...
Setting Up NerdLauncher 455 Finally, add a new class named NerdLauncherFragment that extends from android.support.v4.app.Fragmen ...
Chapter 24 More About Intents and Tasks 456 Resolving an Implicit Intent NerdLauncher will show the user a list of launchable a ...
«
19
20
21
22
23
24
25
26
27
28
»
Free download pdf