Android Bottom Navigation View

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)
}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store