Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Creating a custom view by extending the View class gives you the most control over your custom view. However, you will often need something simpler, such as adding functionality to an existing view. It is much easier to create a custom component by extending one of the built-in Android views and expanding its functionality. By leveraging the built-in view code, you can focus on adding enhanced functionality. A simple way to do this is by creating a new view that combines several existing views. This is called a compound component.
Compound components have two primary advantages over custom views. First, they leverage the existing view group classes to create the layout for you. And second, you won’t need to override the onMeasure and onDraw methods.