O'Reilly logo

Expert Android by Satya Komatineni, Dave MacLean

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter    2

Exploring Compound Controls

In Chapter 1, we said that one of the ways to customize views in Android is to compose (or put together) existing controls as a new compound control. In this chapter, we talk about how to create these custom compound controls.

There are a number of similarities between writing custom compound controls (the topic of this chapter) and directly customizing a standalone view (as what we did in Chapter 1). Managing custom attributes is identical in both types of customization. However, there are subtle but important differences in managing the view state of the custom compound control when compared to a custom view. Also, unlike custom views in which you do your own drawing, in the compound controls you don’t ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required