Chapter 4. Getting the pixels perfect
In this chapter
- Rendering views
- Creating layouts
- Working with themes and styles
- Creating interfaces for mobile apps
I don’t know answers, I just do eyes. You Nexus, huh? I design your eyes.
Blade Runner
This chapter is about all things visual. We’ll see how views are laid out in a hierarchy and drawn to screen in several passes. We’ll also explore more about the layout managers Android provides, and how layout parameters are applied. We’ll then learn how to use themes and styles to customize an application, how to draw custom buttons and other window elements, and how to make user interfaces scale to different devices. Finally, most importantly, we’ll see how to deal with common problems arising in all of these areas along the way. Be aware that this is one of the longest chapters in this book, but don’t fret! It’s also one of the most fundamental and widely applicable, so you’ll find plenty of material here that’ll make your Android developer life easier.