Android BottomNavigationView: Change Icon and Selected Icon

Navigation Item (including text and icon) is specified in a menu file.

<com.google.android.material.bottomnavigation.BottomNavigationView
        ...
        app:menu="@menu/navigation"
        />

Edit res/menu/navigation.xml

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">

    <item
        android:id="@+id/navigation_dailyquote"
        android:icon="@drawable/yy_dailyquote"
        android:title="@string/navigation_dailyquote"/>

        ...
</menu>

To support both icon and selected icon, create res/drawable/yy_dailyquote.xml.

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/yy_dailyquote_sun" android:state_checked="false"/>
    <item android:drawable="@drawable/yy_dailyquote_sun_active" android:state_checked="true"/>
</selector>

NOTE: yy_dailyquote_sun and yy_dailyquote_sun_active are SVG or PNG icon.

You might want to Icon Show Original Multi Color (Disable Tint).

bottomNavigationView.itemIconTintList = null

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.