-
Notifications
You must be signed in to change notification settings - Fork 14
Navigation extension
Davide Giuseppe Farella edited this page Mar 13, 2019
·
1 revision
navDrawer( navController ) {
header { ... }
body {
primaryItem( "messages" ) {
navDestinationId = myDestinationId
navDestinationBundle = myBundle
}
primaryItem( "contacts" ) {
navDestination( myDestinationId ) { mapOf( "arg1" to 15 ) }
}
secondaryItem( "favorites" ) {
navDirections = myNavDirections
}
}
}navDrawer {
...
}myNavDrawer.navController = navControllermyToolbar.setupWithNavController( navController, myNavDrawer, myNavPanel1, myNavPanel2 )myMaterialBottomDrawerLayout.setupWithNavController( navController )
val header = MaterialDrawer.Header()
.iconUrl( IMAGE_URL )
.titleText( "My drawer" )
val messages = PrimaryNavDrawerItem()
.titeText( "messages" )
.navDestination( myDestinationId )
.navDestinationBundle( myBundle )
val contacts = PrimaryNavDrawerItem()
.titeText( "contacts" )
.navDestination( myDestinationId ) { mapOf( "arg1" to "hello" ) }
val body = MaterialNavPanel.Body()
.itemClickListener { id, title -> /* do something */ }
.items( listOf( messages, contacts ) )
drawerLayout.drawer = MaterialNavDrawer( header, body )