blackout blackout - 25 days ago 7
Android Question

How to create an arc shaped custom progress bar in Android?

I'm trying to create a progress bar like the following image.

My requirements are:
1. I want to be able to set a progress value to it programmatically.
2. I want to be able to change the colors of the arc - both the background one (grey) and the foreground one (green).

I looked into libraries but found none that do it in this particular shape and style. I am not proficient enough in creating custom drawables to be able to create this by myself. Any help is appreciated!

enter image description here

Answer Source

In addition to the above answer, you can also use CircleProgress which seems to have something that looks exactly like your use case:

enter image description here

Usage:

<com.github.lzyzsd.circleprogress.ArcProgress
    android:id="@+id/arc_progress"
    android:background="#214193"
    android:layout_marginLeft="50dp"
    android:layout_width="100dp"
    android:layout_height="100dp"
    custom:arc_progress="55"
    custom:arc_bottom_text="MEMORY"/>

Also, if you check the license on this library (bottom of their README), it seems like it's very favorable to using it however you wish.