shapedrawable
Gradient Radius as percentage of screen size
From what I´ve tested, the % does work, but not as you expected. First of all android:gradientRadius=”50″ seems to take the value as pixels 50px android:gradientRadius=”50%” is converted as if 50% = 0.5 px, try android:gradientRadius=”5000%” and you will see a 50px radius. Using %p has a similar result. Obviously this is something I hope … Read more
Applying ColorFilter to ImageView with ShapedDrawable
Alright, I had a quick play with this and noticed your issue of the circles disappearing. Without you describing what exactly you tried, I assume you haven’t tried setting the color filter to the Drawable itself yet? (as opposed to the ImageView, which only seems to work with BitmapDrawables). The following statements work perfectly fine … Read more
Shape Drawable Size not working
For me, setting the gravity of the item to “center” solved the issue. For example: <item android:id=”@android:id/progress” android:gravity=”center”> <clip> <shape> <size android:height=”2dp”/> <solid android:color=”@color/my_color”/> </shape> </clip> </item>
Android how to create triangle and rectangle shape programmatically?
Here it is XML for triangle and rectangle. save it inside drawable folder. triangle.xml <?xml version=”1.0″ encoding=”utf-8″?> <layer-list xmlns:android=”http://schemas.android.com/apk/res/android” > <item > <rotate android:fromDegrees=”45″ android:toDegrees=”45″ android:pivotX=”-40%” android:pivotY=”87%” > <shape android:shape=”rectangle” > <stroke android:color=”@android:color/transparent” android:width=”10dp”/> <solid android:color=”#000000″ /> </shape> </rotate> </item> </layer-list> rectangle.xml <?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=”#B2E3FA” /> </shape> … Read more