How to make a Radial/Circular ProgressBar Not Spin

TheLettuceMaster picture TheLettuceMaster · Jun 13, 2013 · Viewed 16.7k times · Source

I have a horizontal ProgressBar that works great.

  <ProgressBar
                android:id="@+id/progressBar1"
                style="?android:attr/progressBarStyle"
                android:layout_width="match_parent"
                android:layout_height="15dp"
                android:layout_marginBottom="5dp"
                android:background="@drawable/progress_radial_background"
                android:progressDrawable="@drawable/custom_progress_bar" />

I do this:

pb.setMax(100);
pb.set(point);

And it shows the status of a user's level. When it fills all the way, they reach a new level and it starts over. It will only move/increase when the user do some action to increase points.

However, I'd like to make this circular instead of horizontal. But when I do, it wont stop the spinning animation (like a loading animation). Can I make the circular ProgressBar the same way?

Custom Progress Bar code in my Drawable folder:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
    <item
        android:id="@android:id/background"
        android:drawable="@drawable/list_press">
        <corners android:radius="6dp" />
    </item>
    <item android:id="@android:id/progress">
        <clip android:drawable="@drawable/progress_bar_green" />
    </item>
</layer-list>

Answer

BoD picture BoD · Jun 24, 2013

There is no standard Android widget that does what you want.

However you could use this library that does it: https://github.com/Todd-Davies/ProgressWheel.