the issue i have is, that i want to dynamically add top level destinations to my app or at least show the drawer icon on those fragments
currently i have my top level destinations defined like this
val drawerLayout: DrawerLayout = findViewById(R.id.drawer_layout)
val navView: NavigationView = findViewById(R.id.nav_view)
val navController = findNavController(R.id.nav_host_fragment)
appBarConfiguration = AppBarConfiguration(setOf(R.id.nav_all_images, R.id.nav_favourites), drawerLayout)
setupActionBarWithNavController(navController, appBarConfiguration)
navView.setupWithNavController(navController)
i want to dynamically add destinations to categories. when i add them like this:
val s = navView.menu.addSubMenu("Test")
val m = s.add("Category 1")
m.setOnMenuItemClickListener {
navController.navigate(AllImagesFragmentDirections.listToDetail())
drawerLayout.closeDrawers()
return@setOnMenuItemClickListener true
}
it opens it but, with a back button.
is it possible to show the drawer icon / drawer on those destinations ?