Answer the question
In order to leave comments, you need to log in
How to override one item per bottomNavView in Android?
Hello everyone, in android studio there are standard Google templates with Navigation Drawer and a template with Bottom Navigation. Combining them, you get an architecture when MainActivity drives all navigation through nav_graph.
How in this case it is possible to redefine only one item in the bottomNavView, so that when you click on it, the NavigationDrawer opens?
The problem is that using bottomNavView.setOnItemSelectedListener overrides all buttons at once, which is technically impossible.
You can't switch from MainActivity to another fragment using Directions because it's not a host fragment, and you can't use MainActivityDirections from an activity.
bottomNavView.setOnItemSelectedListener { item ->
when (item.itemId) {
R.id.nav_menu -> {
binding.drawerLayout.openDrawer(Gravity.LEFT)
}
R.id.nav_map -> {
navController.navigate(MainActivityDirections.action...)
[email protected] false
}
R.id.nav_favourites -> {
navController.navigate(MainActivityDirections.action...)
[email protected] false
}
R.id.nav_home -> {
navController.navigate(MainActivityDirections.action...)
[email protected] false
}
}
[email protected] false
}
Answer the question
In order to leave comments, you need to log in
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]*)\.html$ /index.php?page=$1 [END,QSA]
RewriteRule ^([^/]*)$ /index.php?page=$1 [END]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question