Setting the Dialog’s Content
Now that the dialog can show and hide itself, you can focus on its content. Start by adding a string resource to show in the dialog.
Listing 28.5 Asking important questions (strings.xml
)
<resources> ... <string name="place_order_button">Place order (%1$s)</string> <string name="placement_prompt">Where do you want %1$s on your pizza?</string> <string name="placement_none">None</string> <string name="placement_left">Left half</string> <string name="placement_right">Right half</string> <string name="placement_all">Whole pizza</string> ... </resources>
Now you are ready to start building the real UI to appear in the dialog. Remove the temporary Box and replace it with a Card. Card includes a background, ...
Get Android Programming: The Big Nerd Ranch Guide, 5th 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.