Question

My code has 5 drawable folders (drawable, drawable-mdpi, drawable-hdpi, drawable-xhdpi, drawable-sw330dp). Each one is used for different screen densities. I have tested each resolution and adjusted accordingly. The only problem so far is that when I test the application on a Droid RAZR, my shapes are drawn incorrectly. The screen size for that particular phone is 540px x 960px.

I have tried three different drawable folder names:

1) drawable-sw330dp

2) drawable-sw540dp

3) drawable-sw225dp << This was suggested by @CommonsWare below

None are adjusting to the xml files that are stored within. It seems like the phone is using the drawable-hdpi instead of going into the specific (sw) folder. Is there another way to make sure that the phone references the right folder?

enter image description here

Example xml file that draws the shapes (used as a background):

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

<item>
    <shape android:shape="rectangle" >
        <solid android:color="@color/menu_active" />

        <padding android:left="1dp" />
    </shape>
</item>
<item>
    <rotate
        android:fromDegrees="135"
        android:pivotX="96.5%"
        android:pivotY="82%"
        android:toDegrees="45" >
        <shape android:shape="rectangle" >
            <solid android:color="#000" />

            <padding android:left="1dp" />
        </shape>
    </rotate>
</item>

Was it helpful?

Solution 2

It looks like drawable-w330dp-normal works for the Droid RAZR. Just create the folder and store the modified drawable there.

OTHER TIPS

The DROID RAZR's screen density should be ~256ppi. Motorola probably put it in the -hdpi density bucket as a result. The shortest width, therefore, would be 225dp, which is smaller than any of your -swNNNdp resource sets.

Put image resources for MOtorola RAZR in folder: drawable-hdpi

Android supported next formats for drawable assets:

1)drawable-ldpi

2) drawable-mdpi

3)drawable-hdpi

4)drawable-xhdpi

5)drawable-xxhdpi

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top