How to draw a circle inside a circle using Android xml shapes?

The only way I’ve gotten this to work is to define a transparent stroke for the inner (i.e., top) circle that’s the difference between the size of the larger and smaller circle. For example, this: <?xml version=”1.0″ encoding=”utf-8″?> <layer-list xmlns:android=”http://schemas.android.com/apk/res/android”> <!– Larger blue circle in back –> <item> <shape android:shape=”oval”> <solid android:color=”#00f”/> <size android:width=”15dp” android:height=”15dp”/> … Read more

Android – make an arrow shape with xml

What you need is to create a shape xml file in your project’s drawable-xxx folder and then use this shape as background for a button. Here is the shape file called arrow_shape.xml: <?xml version=”1.0″ encoding=”UTF-8″?> <layer-list xmlns:android=”http://schemas.android.com/apk/res/android” > <!– Colored rectangle–> <item> <shape android:shape=”rectangle”> <size android:width=”100dp” android:height=”40dp” /> <solid android:color=”#5EB888″ /> <corners android:radius=”0dp”/> </shape> </item> … Read more

Open-sided Android stroke?

I achieved a good solution with this one: <?xml version=”1.0″ encoding=”utf-8″?> <layer-list xmlns:android=”http://schemas.android.com/apk/res/android”> <!– This is the line –> <item android:top=”-1dp” android:right=”-1dp” android:left=”-1dp”> <shape> <solid android:color=”@android:color/transparent” /> <stroke android:width=”1dp” android:color=”#ffffff” /> </shape> </item> </layer-list> This works well in case you need a transparent background but still an open stroke color (In my case I only … Read more