How can I create circle shape with gradient line as a drawable resource, something like this:
2 Answers
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:innerRadiusRatio="3" android:shape="ring" android:thicknessRatio="8" android:useLevel="false"> <gradient android:angle="270" android:centerX="50%" android:centerY="50%" android:endColor="#FF4AA7D0" android:gradientRadius="100" android:startColor="#FFE66433" android:type="linear" android:useLevel="false" /> </shape> 1 Comment
Jeff Bootsholz
how to make the circle ring thinner?
This is a simple circle as a drawable in Android.
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> <solid android:color="#666666"/> <size android:width="120dp" android:height="120dp"/> </shape> and you can apply a color filter from Java code (see Drawable class)
