Circular Setting ProgressBar – Android Studio Tutorial



By default, Android only offers a ProgressBar that is not specific to the circular, contains a rotating animation and indicates that something is being loaded, but does not display actual progress. If we want a specific progress bar that shows progress, we usually have to set it on the horizontal progression bar with style = "? Android: progressBarStyleHorizontal".
In this video, you'll learn how to create …

35 Comments

  1. Reply

    Great tutorial. Here's how I modified the XML file to start progress from the top and to put a gray background like the horizontal progress bar has:

    <?xml version="1.0" encoding="utf-8"?>
    <layer-list xmlns:android="http://schemas.android.com/apk/res/android"&gt;
    <item>
    <shape
    android:shape="ring"
    android:thicknessRatio="16"
    android:useLevel="false">
    <solid android:color="#DDDDDD" />
    </shape>
    </item>
    <item>
    <rotate
    android:fromDegrees="270"
    android:toDegrees="270"
    android:pivotX="50%"
    android:pivotY="50%" >
    >
    <shape
    android:shape="ring"
    android:thicknessRatio="16"
    android:useLevel="true">
    <solid android:color="@color/colorAccent" />
    </shape>
    </rotate>
    </item>
    </layer-list>

  2. Reply

    I really love the short time of this video which directly goes into the concepts rather explaining how to create a new android project in android studio in every single video one makes. Thank you and keep up the great work!

  3. Reply

    Hello there, i want to hide all my Views when i use SearchView in my Activity and want to show ProgressBar during the image load… Need your help plz….

  4. Reply

    For anyone who encountered the problem of using setProgress which requires API level >= 24.
    You can use setProgress(percent)to avoid the problem. setProgress(percent, animate: false) with animate input requires higher API

  5. Reply

    I don't have my work PC with me to experiment so I'll ask… how could I add a textview in the middle of the ring showing the progress percentage in its numeric representation, ie "25%"?

  6. Reply

    Thank you very much for the tutorial …. how could a ProgressBar be implemented?
    in an activity that shows a WebView? It is very complex?

  7. Reply

    Hi there 🙂
    I'd like to combine this cool progress bar with a gradient color,
    So I wrote this:
    <shape>
    <gradient
    android:startColor="#ff3e9a94"
    android:centerColor="#ff42959a"
    android:endColor="#ff23729a"
    android:angle="135"
    />
    </shape>

    in the layout file I wrote:
    <ProgressBar
    android:id="@+id/progressBarCircle"
    android:layout_width="150dp"
    android:layout_height="150dp"
    tools:progress="80"
    android:progressDrawable="@drawable/circle"

    But it seems to fail, can you please assist me? thank you!

Leave Comment

Your email address will not be published. Required fields are marked *