Achin Achin - 1 month ago 22
Android Question

Android Navigation drawer item icon showing pixelated

i have created navigation drawer and I'm trying to show an icon next to an item within my menu for my navigation drawer but my icons on navigation drawer are showing blur and pix-elated and my icons size is 72x72 , i will share my code and screen shots

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">

<include
layout="@layout/app_bar_dash_board"
android:layout_width="match_parent"
android:layout_height="match_parent" />

<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:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_dash_board"
app:menu="@menu/activity_dashboard_drawer" />

</android.support.v4.widget.DrawerLayout>


and my menu items xml is

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

<group android:checkableBehavior="none">
<item
android:id="@+id/nav_Scheduled"
android:icon="@drawable/ic_schedule_black_24dp"
android:title="Scheduled" />
<item
android:id="@+id/nav_Completed"
android:icon="@drawable/ic_done_black_24dp"
android:title="Completed" />
<item
android:id="@+id/nav_Pending"
android:icon="@drawable/ic_remove_circle_black_24dp"
android:title="Pending" />
<item
android:id="@+id/nav_inprogress"
android:icon="@drawable/ic_replay_30_black_24dp"
android:title="In-Progress" />

<item
android:id="@+id/nav_Settings"
android:icon="@drawable/ic_settings_black_24dp"
android:title="Settings" />
<item
android:id="@+id/nav_Support"
android:icon="@drawable/ic_info_outline_black_24dp"
android:title="Support" />
<item
android:id="@+id/nav_logout"
android:icon="@drawable/ic_settings_power_black_24dp"
android:title="Logout" />
</group>


</menu>


enter image description here

Answer

The Navigation Icons Size should be different for all the Drawable folders to avoid the blur,pix-elated issue. The Navigation Icon Size's for all the Drawable Folders are below,

->mdpi : 24 x 24 px

->hdpi : 36 x 36 px

->xhdpi : 48 x 48 px

->xxhdpi : 72 x 72 px

->xxxhdpi : 96 x 96 px