Reputation: 11
How can I create circle shape with gradient line as a drawable resource, something like this:
Upvotes: 1
Views: 418
Reputation: 2618
<?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>
Upvotes: 3
Reputation: 529
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)
Upvotes: -1