i m using navigation drawer in old project but i got new project in this project they used navigation view so what is the difference beet been these two. which is the best for good for customize .
The navigation drawer is a UI panel that shows your app's main navigation menu. The drawer appears when the user touches the drawer icon in the app bar or when the user swipes a finger from the left edge of the screen.
com.google.android.material.navigation.NavigationView. Represents a standard navigation menu for application. The menu contents can be populated by a menu resource file. NavigationView is typically placed inside a DrawerLayout .
DrawerLayout acts as a top-level container for window content that allows for interactive "drawer" views to be pulled out from one or both vertical edges of the window.
NavigationDrawer
is a panel that displays the App’s Navigation option from the left edge of the screen.
and NavigationView
is the builtin class/tag through which you tell the drawer what it looks like.
NavigationView
consists of two main elements (these are optional):
NavigationView
If you don't want to use both then you don't need to use it. You can simply put your custom code (XML) inside DrawerLayout
.
An easy example will help you to understand all the game.
Navigation View is a widget provided by the android which you can use inside a Drawer. Navigation View makes it very easy to create a navigation menu inside your app.
Refer this for more:
https://developer.android.com/reference/android/support/design/widget/NavigationView.html
Navigation Drawer is nothing but a container where your navigation menu resides. Either you can use NavigationView for creating a highly customizable menu or you can simply use a listview to provide the menu items.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With