material-components-android
material-components-android copied to clipboard
[NavigationView] isVisible does not completely hide/show items
trafficstars
Description:
I have a problem with the menu of a NavigationView: i want to hide menu-items and re-show them later (e.g. login/logout buttons).
but when setting
menu.findItem(R.id.nav_login)?.isVisible = !isLoggedIn
menu.findItem(R.id.nav_logout)?.isVisible = isLoggedIn
the login-item is getting invisible instead of gone (and the logout-item does not show up at all).
To get it working, I need to click on an other item. and this other item needs to be in a group with android:checkableBehavior="single" (my login/logout items are in a group with none).
Expected behavior:
Items set to invisible should be gone and re-appear when set to be visible again without the need of clicking on an item in a android:checkableBehavior="single"-group.
Material Library version: 1.2.0-alpha04