Chapter 26. Advanced UI with Navigation Drawer and Fragment
In this chapter, we will see what is (arguably) the most advanced UI. The NavigationView,
or navigation drawer (because of the way it slides out its content), can be created simply by choosing it as a template when you create a new project. We will do just that, and then we will examine the auto-generated code and learn how to interact with it. We will then use everything we know about the Fragment
class to populate each of the "drawers" with different behaviors and views. Then, in the next chapter, we will learn about databases to add some new functionality to each Fragment
.
In this chapter, the following topics will be covered:
- Introducing the
NavigationView
widget - Getting started with the Age Database app
- Implementing a
NavigationView
using the project template - Adding multiple
Fragment
instances and layouts toNavigationView
Let's take a look at this extremely cool UI pattern.