I want to make a progress bar with a donut shape with rounded edges, looking like this:
I tried this so far:
ProgressBar in XML :
<ProgressBar style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_centerInParent="true"
android:indeterminate="false"
android:max="100"
android:progress="0"
android:layout_margin="2dp"
android:progressDrawable="@drawable/shape_ring_gradient"
android:rotation="-90.0"
android:visibility="visible"
android:id="@+id/progress_bar" />
shape_ring_gradient.png :
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="ring"
android:innerRadiusRatio="2.17391304"
android:thicknessRatio="25.0"
android:useLevel="true">
<gradient
android:endColor="#FE000A"
android:gradientRadius="1000"
android:startColor="#EB288B"
android:angle="180"
android:type="linear" >
</gradient>
</shape>
Java code:
ProgressBar progressBar = getView().findViewById(R.id.progress_bar);
progressBar.setProgress(82);
Result :
Now my question is, how can I :
- Make the ring thicker?
- Round the edges?
Thanks for your help!