5. Reusable UI

In the last chapter, you got an introduction to some of the common views available on Android and used those views to create a new interface for the TimeTracker app. Now you will expand that knowledge to create reusable components that you can use throughout the application. In this chapter, you’ll learn that views can be abstracted and reused in other layouts by using the <include> tag; that using the ViewStub class can reduce the performance impact of the <include> tag; that themes can be applied to your entire application with a simple XML file; and that the new fragments APIs can be used to further abstract your UI into logical blocks that are suitable for phones, tablets, and televisions.

Abstracting Your Layouts

Reusing components ...

Get Android UI Fundamentals: Develop and Design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.