Android Programming: The Big Nerd Ranch Guide, 5th Edition
by Bryan Sills, Brian Gardner, Kristin Marsicano, Chris Stewart
Layouts in Compose
Time to begin building out the views that Coda Pizza will present to its users. Let’s focus on the scrollable list of toppings. First, as you did for your RecyclerView in CriminalIntent, you will construct a cell that will appear for each topping choice. You will come back to the actual scrolling behavior at the end of this chapter.
The cell will have three elements: the name of the topping, a checkbox indicating whether the topping is on the pizza, and a description of where the topping will appear on the pizza (the left half, the right half, or the whole pizza). Start with the two Text elements.
In Chapter 2, we told you that flat (non-nested) layouts are faster for the OS to measure and lay out. That is true ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access