Chapter 2. Understanding Views—The UI Building Blocks

Sometimes it is best to start with the building blocks before diving into much more complex topics, and that is the goal here. This chapter is all about views, which allow your apps to display their content to your users. You will learn all the major view subclasses and gain a fundamental understanding of key attributes such as view IDs, padding, and margins. If you have already built any apps, most of this will be review for you, so feel free to skim through the chapter as you move toward the heart of the book.

What Is a View?

Views are the most basic component of the UI, and they extend the View class. They always occupy a rectangular area (although they can display content of any shape) ...

Get Android User Interface Design: Implementing Material Design for Developers, Second Edition 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.