material-components-android icon indicating copy to clipboard operation
material-components-android copied to clipboard

[NavigationView] isVisible does not completely hide/show items

Open hardysim opened this issue 5 years ago • 1 comments
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

hardysim avatar Feb 19 '20 13:02 hardysim