5.5 Building the App’s GUI

In this section, you’ll create the app’s GUI and create the classes for the app’s dialogs.

5.5.1 content_main.xml Layout for MainActivity

The content_main.xml layout for this app’s MainActivity contains only the MainActivityFragment, which was created automatically when you created the project. For more readable code, we changed the fragment’s id property:

  1. Open content_main.xml in the layout editor’s Design view.

  2. Select the fragment in the Component Tree, then change the Fragment’s id to doodleFragment in the Properties window and save the layout.

5.5.2 fragment_main.xml Layout for MainActivityFragment

The fragment_main.xml layout for the MainActivityFragment needs to display only a DoodleView. The layout file ...

Get Android How to Program, 3/e 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.