chip-navigation-bar
                                
                                 chip-navigation-bar copied to clipboard
                                
                                    chip-navigation-bar copied to clipboard
                            
                            
                            
                        Icon animation "state_checked"=true/false not working
Just like material bottom navigation bar I want to achieve something like: When icon selected : filled icon When icon not selected : Outlined icon
IN PLACE OF MENU ITEMS ICON I'M USING BELOW XML FILE :
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/homeoutline" android:state_checked="false"/>
    <item android:drawable="@drawable/homefilled" android:state_checked="true"/>
</selector>
But this is not working I'm getting outlined icon every time whether icon selected or not selected. Please help.
Just like material bottom navigation bar I want to achieve something like: When icon selected : filled icon When icon not selected : Outlined icon
IN PLACE OF MENU ITEMS ICON I'M USING BELOW XML FILE :
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/homeoutline" android:state_checked="false"/> <item android:drawable="@drawable/homefilled" android:state_checked="true"/> </selector>But this is not working I'm getting outlined icon every time whether icon selected or not selected. Please help.
try android:state_selected not android:state_checked
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/homeoutline" android:state_selected="false"/>
    <item android:drawable="@drawable/homefilled" android:state_selected="true"/>
</selector>