0

After long study from Best way to handle shape drawable differences Android 2.3.5 vs 4.0 , Drawable-hdpi, Drawable-mdpi, Drawable-ldpi Android , And this tutorial and this best tutorial I have started to do sample application.

I have stored the following shape in res/drawable-ldpi

<stroke
    android:width="2dp"
    android:color="#FFFFFFFF" />

<gradient
    android:angle="225"
    android:endColor="#ffa500"
    android:startColor="#DD000000" />
<corners
    android:bottomLeftRadius="0dp"
    android:bottomRightRadius="7dp"
    android:radius="0.1dp"
    android:topLeftRadius="0dp"
    android:topRightRadius="7dp" />

and the following in res/drawable-hdpi,res/drawable-mdpi,res/drawable-xhdpi,res/drawable-v14

<stroke
    android:width="2dp"
    android:color="#FFFFFFFF" />

<gradient
    android:angle="225"
    android:endColor="#ffa500"
    android:startColor="#DD000000" />

<corners
    android:bottomLeftRadius="7dp"
    android:bottomRightRadius="0dp"
    android:radius="0.1dp"
    android:topLeftRadius="0dp"
    android:topRightRadius="7dp" />

it looks like this in all type of emulators . that is in hvga , qvga , version 4.0.3 and samsung duos enter image description here

but in micromax funbook why it looks like this.

enter image description here

what's the problem here. Is there anything else I want to do. Help me friends. Thanks in advance.

Community
  • 1
  • 1
Gunaseelan
  • 14,415
  • 11
  • 80
  • 128

1 Answers1

2

Try to put the first one into res/drawable

and the second in res/drawable-v14

remove the others from res/drawable-ldpi, res/drawable-hdpi, res/drawable-mdpi, res/drawable-xhdpi

[Update]

Why to remove from other res/drawable-XXX folder:
Android always takes the best drawable for the device. as you just need other versions for android < 4.0 and >= 4.0 you only need this two directories

Android Developer Docu on this Topic

Dodge
  • 8,047
  • 2
  • 30
  • 45
  • can you explain me little bit more why i cant have that in specific folders friend. – Gunaseelan Mar 13 '13 at 11:00
  • you can have, but you dont need. :) android always takes the best drawable for the device. as you just need other versions for android < 4.0 and >= 4.0 you only need this two directories – Dodge Mar 13 '13 at 11:05
  • @ClassStacker the problem is, that there seems to be a bug in android, having the correct XML resulting in wrong shape. (at least that is how i understand this question and the question he [linked](http://stackoverflow.com/questions/8547586/best-way-to-handle-shape-drawable-differences-android-2-3-5-vs-4-0)). If this issue is real (i didn't test it) then the solution i provided should work exactly how he wanted it. – Dodge Mar 14 '13 at 07:45
  • and i bet, if my solution would not work for him, he had not accepted it – Dodge Mar 14 '13 at 07:46
  • i just edited/updated the answer. feel free to remove the downvote – Dodge Mar 14 '13 at 08:13