almisoft
almisoft

Reputation: 2183

Drawable blurred on some devices

This refresh drawable is blurred on some devices, e.g. Galaxy Tab 10.1N (Android 3.2). No problems on my Nexus 7 (Android 4.4).

enter image description hereenter image description here

<ImageButton
    android:id="@+id/buttonrefresh"
    android:layout_width="52dip"
    android:layout_height="fill_parent"
    android:layout_alignParentRight="true"
    android:adjustViewBounds="true"
    android:scaleType="fitCenter"
    android:background="@drawable/widget_button_background"
    android:padding="2dip"
    android:src="@drawable/ic_action_refresh"/>

ic_action_refresh is located in res/drawable_xxhdpi and has the size of 96x96 pixels. What could be the reason?

Upvotes: 3

Views: 607

Answers (2)

Justin Pollard
Justin Pollard

Reputation: 6679

I think you're going to want to add appropriate drawable resources for mdpi, hdpi, and xhdpi in addition to xxhdpi. This will allow the OS to choose the correct drawable resource based on the pixel density of each device's screen.

Upvotes: 1

michal.luszczuk
michal.luszczuk

Reputation: 2903

Becuse galaxy tab 10.1 is not XXHDPI, it's probably MDPI (but i don't know), so Android system is scaling this big resource to MDPI and with scaling quality is lost. You should scale resources on your own and use few resource folders for many screen dpi's (drawable-mdpi, drawable-hdpi... and so on)

Upvotes: 6

Related Questions