4
I noticed that you are using the Default Navigation Drawer, so to change the icons and customize as you want, just go in the folder menu
and in the archive activity_main_drawer.xml
and make the changes as you wish.
Take an example:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:title="@string/menu1">
<menu>
<item
android:icon="@drawable/ic_check_box"
android:id="@+id/nav_um"
android:title="@string/categoria1" />
<item
android:icon="@drawable/ic_check_box"
android:id="@+id/nav_dois"
android:title="@string/categoria2" />
<item
android:icon="@drawable/ic_check_box"
android:id="@+id/nav_tres"
android:title="@string/categoria3" />
<item
android:icon="@drawable/ic_check_box"
android:id="@+id/nav_quatro"
android:title="@string/categoria4" />
<item
android:icon="@drawable/ic_check_box"
android:id="@+id/nav_cinco"
android:title="@string/categoria5" />
<item
android:icon="@drawable/ic_check_box"
android:id="@+id/nav_seis"
android:title="@string/categoria6" />
</menu>
</item>
<item android:title="@string/menu2">
<menu>
<item
android:icon="@drawable/ic_check_box"
android:id="@+id/nav_sete"
android:title="@string/categoria7" />
<item
android:icon="@drawable/ic_check_box"
android:id="@+id/nav_oito"
android:title="@string/categoria8" />
<item
android:icon="@drawable/ic_check_box"
android:id="@+id/nav_nove"
android:title="@string/categoria9" />
<item
android:icon="@drawable/ic_check_box"
android:id="@+id/nav_dez"
android:title="@string/categoria10" />
</menu>
</item>
<item android:title="@string/menu3">
<menu>
<item
android:id="@+id/nav_sobre"
android:icon="@drawable/ic_storage_24dp"
android:title="@string/menusobre" />
<item
android:id="@+id/nav_sair"
android:icon="@drawable/ic_clear_24dp"
android:title="@string/menusair" />
</menu>
</item>
</menu>
Note that the Android Studio IDE offers a very useful tool, which is the Vector Asset
for you to create a custom icon, just right click on the folder drawable
> New
> Vector Asset
See that above the new icon is in the folder drawable
, so now just edit your file activity_main_drawer.xml
, in that way:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:title="@string/menu1">
<menu>
<item
android:icon="@drawable/ic_3d_rotation_black_24dp"
android:id="@+id/nav_um"
android:title="@string/categoria1" />
I hope I’ve helped.
Man, thank you so much. You helped me so much. Now yes. Thanks so much.
– Artur Mafezzoli Júnior