I'm using a NavigationRailView (com.google.android.material.navigationrail.NavigationRailView
) in my Android application and I'm trying to change the colour of a single item in the navigation rail to make it look "disabled". I've tried the following code but while it does disable the menu item, it doesn't actually look disabled:
val menuItem = binding.navRailView.menu.findItem(R.id.item3)
menuItem.isEnabled = false
menuItem.isCheckable = false
Using the follow code I found online doesn't seem to let me change the colour either. (I have verified that the resource colour is correct with another View element)
menuItem.setIconTintList(baseContext.getColorStateList(R.Color.view_disabled))
Anyone has any idea or is it not possible to do so right now?