1

How can I create circle shape with gradient line as a drawable resource, something like this:

enter image description here

2 Answers 2

3
<?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> 
Sign up to request clarification or add additional context in comments.

1 Comment

how to make the circle ring thinner?
-1

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)

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.