N
N
newdancer2017-08-10 13:55:53
Android
newdancer, 2017-08-10 13:55:53

How to set different item colors for NavigationDravable?

How to set different item colors for NavigationDravable?
Have NavigationView

<android.support.design.widget.NavigationView
        android:id="@+id/nav_view"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:background="@color/colorWhite"
        android:fitsSystemWindows="true"
        app:headerLayout="@layout/nav_header_main"
        app:itemBackground="@drawable/st_drawer_list_selector"
        app:itemIconTint="@drawable/st_drawer_icon_selector"
        app:itemTextColor="@drawable/st_drawer_text_selector"
        app:menu="@menu/activity_main_drawer" />

there is selector for icon and text
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:color="@color/colorIconDrawable" android:state_checked="true" />
    <item android:color="@color/colorIconDrawable" android:state_enabled="false" />
    <item android:color="@color/colorGreyish" android:state_enabled="false" />
</selector>

So the android:state_checked="true" and android:state_enabled="false" statuses work. But when I do item enable = false status android:state_enabled="false" does not work? Why?!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question