Android Programming: The Big Nerd Ranch Guide, 5th Edition
by Bryan Sills, Brian Gardner, Kristin Marsicano, Chris Stewart
Challenge: Pizza Sizes and Drop-Down Menus
For this challenge, you will expand the customization options available in Coda Pizza. Currently, it is only possible to order a pizza in a single size. You will change that by adding another UI element to prompt the user to choose a pizza size.
For some UI interactions, a dialog can be a bit intrusive. It forces your users to interact with a specific message and hides the rest of your application’s UI. As an alternative, you can use a drop-down menu to show a set of options that blocks a much smaller portion of your UI. You saw a drop-down menu in Chapter 15 when menu items in your app bar were relegated into an overflow menu.
Creating a drop-down menu in Compose is similar to how you created ...
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