A (175)

(Tuis.) #1

350 CHAPTER 9: Android Graphic Design: Making Your UI Designs Visual


I have opened the /res/drawable and /res/drawable-mdpi folders in Figure 9-35, to show all of the
files which we have been creating during the chapter. I used a Refresh command to make them all
visible to Eclipse after I had copied them (ninepatchasset.9.png), and saved them directly into my
project resource folder hierarchy.


Also shown in Figure 9-35 are the android:padding="2dip" parameters in each of the


tags, and the modification to the android:layout_marginTop="24dip" parameter that
I had to add into both of those nested LinearLayout containers in the second content pane, in order
to push the text content down into the NinePatchDrawable asset’s frame.

Congratulations, you have implemented a plethora of advanced, axis-independent scaling,
interactive graphic design Android UI element attributes which aren’t even covered in more
advanced Android development books!


Summary


In this ninth chapter, you learned all about 2D graphic design concepts and principles, as well as
about Android drawables and supported image formats, including the unique NinePatch image
format used to create a type of “drawable” in Android called a NinePatchDrawable. You learned
how to create a NinePatch using the Android Draw 9-patch software utility, and eventually
implemented it inside of your SlidingPaneLayout UI design.


Figure 9-35. Adding the NinePatchDrawable asset to the SlidingPaneLayout and adjusting the UI design margins

Free download pdf