Following folder structure is working fine for the mentioned devices and resolutions:
The problem is with the Nexus 10 and Samsung Galaxy Tab 10 (Tab is with Android 4.0 & mdpi). To handle both devices I added two separate drawable folders:
However, both Nexus 10 and Samsung Galaxy Tab 10 are using images from drawable-sw800dp-xhdpi.
Similar result, both Nexus 10 and Samsung Galaxy Tab 10 are using images from drawable-sw720dp-xhdpi.
I also tried to use drawable-xlarge-mdpi
and drawable-xlarge-xhdpi
(removed drawable-sw800dp-mdpi & drawable-sw800dp-xhdpi) to handle Samsung Galaxy Tab 10 but Tab is with Android 4.0 and xlarge
structure is deprecated. So it is taking according to the new directory structure (i.e., drawable-sw600dp-xhdpi).
In Eclipse graphical layout editor correct images (from drawable-sw800dp-mdpi) are shown after selecting 10.1" WXGA (Tablet) which is like Samsung Galaxy Tab 10. However, when I test the same thing in device or emulator it is showing images from drawable-sw800dp-xhdpi.
Manifrest:
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
Layout:
layout
values:
values
values-sw320dp
values-sw600dp
values-sw800dp
So what should be the drawable folders for Nexus 10 and Samsung Galaxy Tab 10?
You can use drawable folders in this format:
drawable-480x320
drawable-1280x800
drawable-2560x1600
...
etc
To solve the problem of mdpi tablet load the resource inf "drawable-sw720dp-xhdpi", use this way:
The drawable names "R.drawable.ic_xxx";
drawable-xhdpi put your Nexus 10 pic, named as ic_xxx_720.png;
drawable-mdpi put your Samsung Galaxy Tab 10 pic, named as ic_xxx_720.png;
then in values-sw720dp put resource alias:
<item name="ic_xxx" type="drawable">ic_xxx_720.png</item>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With