Android Bottom Navigation View
2 min readMay 1, 2020
Tutorial shows how to enable/disable visibility of an Android bottom navigation view tap depending on a control flag. This is good when you want to enable a tab only for some users.
Add below Kotlin code snippet to enable or disable the “Premium” tab.
fun onCreate() {
if (!ExperimentSettings.isPremiumTabEnabled()) {
navigationBar.menu.removeItem(R.id.menu_navigation_premium)
}
navigationBar.setOnNavigationItemSelectedListener(this)
}