Coding the Fragment classes and their layouts
We will create the four classes, including the code that loads the layout as well as the actual layouts, but we won't put any of the database functionality into the Kotlin code until we have learned about Android databases in the next chapter.
Once we have our four classes and their layouts, we will see how to load them from the navigation drawer menu. By the end of the chapter, we will have a fully working navigation drawer that lets the user swap between fragments, but the fragments won't do anything until the next chapter.
Creating the empty files for the classes and layouts
Create four layout files with vertical LinearLayout
as their parent view by right-clicking on the layout
folder and selecting ...
Get Android Programming with Kotlin for Beginners 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.