A navigation drawer is a UI component that slides in from the side of the device to show a navigation menu. In this video, add a navigation drawer and menu to an existing activity.
- [Instructor] A navigation drawer … is a visual component that slides in … from the side of the screen presenting … a menu of navigation options. … It typically provide navigation tools … for the entire app in this interface … and reserve the options menu for tools … that only apply to the current activity. … I previously showed how to add navigation … from the options menu but now I'm going to … move them into a navigation drawer. … I'll start by creating a new menu file … and I'll create it by copying the options menu file. … I'll press controller command C to copy … and then controller command V to paste … and I'll set the name of the new file to nav_main.xml. … In a nav drawer, you don't have the option … to show as action so I'll delete that … and then I'll select and duplicate this item … and I'll set the first one with a title … of settings and an ID of action_settings. … I'll follow the good practice of making sure I've taken … any literal strings and put them into string resources. …
Looking for study partners?Join the Associate Android Developer Exam study group
The Android app architecture constantly evolves. The introduction of the Kotlin programming language, new form factors such as Chromebooks, and reusable architecture components have made it faster and easier than ever to build high-quality Android apps. It is imperative that developers understand what the latest tools and recommendations are and how to use them to build out their applications. In this course, instructor David Gassner explains how to build an Android app that uses Kotlin instead of Java, add navigation functionality, and leverage the most useful architecture components such as LifecycleObserver, ViewModel, and LiveData, to create apps that are robust and easy to maintain over time.
- Handling lifecycle events
- Handling view events
- Updating display from new data
- Adding ViewModels to activities
- Subscribing to changes in LiveData values
- Adding a new launcher activity
- Starting activities with explicit intents
- Sharing data with implicit intents
- Adding a navigation drawer
- Adding a header to a navigation drawer
- Handling navigating drawer menu events