android bottom navigation hiding views
private fun setupNav() {
val navController = findNavController(R.id.nav_host_fragment)
findViewById<BottomNavigationView>(R.id.bottomNav)
.setupWithNavController(navController)
navController.addOnDestinationChangedListener { _, destination, _ ->
when (destination.id) {
R.id.mainFragment -> showBottomNav()
R.id.mineFragment -> showBottomNav()
else -> hideBottomNav()
}
}
}
private fun showBottomNav() {
bottomNav.visibility = View.VISIBLE
}
private fun hideBottomNav() {
bottomNav.visibility = View.GONE
}
Also in Java:
- android get sdk version
- java fx display simple rectangle
- java resource file
- throwing exceptions java
- java file path linux
- Enums injava
- java singleton
- create notification android
- code to include layout from java in android
- java how to print a newline
- convert date to calendar java
- how to multiply a number by itself using for loop in java
- Spigot API inventory close
- system.out.println shortcut
- initialiser une arraylist
- change brightness of image in java
- java string util if empty default
- runtime java examples
- java import text file into arraylist
- processing play sound
- how to count number of words in a string
- function in java
- java swing dialog box
- count word in string no matter the delimiter java