I want to create a drawable like this for my progress bar
and I've tried this code, but I didnt get what I want
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/progress">
<shape
android:innerRadiusRatio="3"
android:shape="ring"
android:useLevel="false">
<gradient
android:centerColor="#ffff00"
android:endColor="#00ff00"
android:startColor="#fb0000"
android:type="sweep" />
</shape>
</item>
</layer-list>
This is what I've got
Is it possible to do this with only xml? Or this is should be done with java code?
Since you asked in comments how do you do that and I can't put these links in a comment, I'll suggest you these three links. Read them and extract what you want:
how to draw a half circle in android
Draw a semicircle in the background of a View
https://github.com/devadvance/circularseekbar
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With