Circular Determinate ProgressBar – Android Studio Tutorial



By default Android only offers a circular indeterminate ProgressBar, that has a spinning animation and indicates that something is loading, but doesn’t show the actual progress. If we want a determinate progress bar that shows the progress, we usually have to set it to a horizontal ProgressBar with style=”?android:progressBarStyleHorizontal”.
In this video you’re going to learn, how to create a circular determinate ProgressBar with the progressDrawable attribute and a self made XML drawable.

Example code:

____________________
❗ Subscribe to the channel:

⏯ Watch more tutorials:

⭐ Become a channel member for exclusive tutorials and other perks:

㊙ Help translating the videos:

💚 Support the content:

💬 Join the Discord chat:

🎧 Audiobooks and podcasts for programmers:

👶 How to get started with Android development:

📣 Follow Coding in Flow on social media:

Facebook:

Instagram:

Twitter:

Blog:

Nguồn: https://katieeliselambert.com

Xem thêm bài viết khác: https://katieeliselambert.com/giai-tri/

Article Categories:
Giải Trí

All Comments

  • 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">
    <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>

    Rupert Rawnsley May 27, 2020 3:18 am Reply
  • Great video!

    Marlín Sarmiento May 27, 2020 3:18 am Reply
  • Thanks!

    Carlos Aguirre May 27, 2020 3:18 am Reply
  • Wow.
    the best tutor ever. I have learnt constraint layout from this channel and hope to learn more.
    What's your name again, Sir?

    Code Generator May 27, 2020 3:18 am Reply
  • My goal was to stop ProgressBar spinning. I was about to reject using ProgerssBar and switch to another solution or even a custom view, but your tutorial came out with a simple workaround. Thanks a lot!

    Вадим Чурун May 27, 2020 3:18 am Reply
  • Ty so much. The inner circle ring animation was very nice

    Gustav Bentzen May 27, 2020 3:18 am Reply
  • Doesn't work on android
    Ugh you're using desktop and this video is do those very advanced in knowledge. Have know idea how you even got to where you are. Unless to me

    MG May 27, 2020 3:18 am Reply
  • Really is helpful tutorial, but pleas broo I use tecno hot 5 and there is Circle bar loading on the screen can you please help me how can I remove it?

    Faba Fabaz May 27, 2020 3:18 am Reply
  • great tutorial

    a Woolen Sleevelet May 27, 2020 3:18 am Reply
  • How can I see window showing progress in real time? https://www.youtube.com/watch?v=hSfN_aYKkzo&t=247 the right side of your video.

    장성혁 May 27, 2020 3:18 am Reply
  • in germany we call this great vid

    nilstest nilseru May 27, 2020 3:18 am Reply
  • Please make a video on Round Seekbar.

    Deepak shah May 27, 2020 3:18 am Reply
  • awesome

    java lover May 27, 2020 3:18 am Reply
  • Very useful! And very professionally mounted!

    Санкаршана дас May 27, 2020 3:18 am Reply
  • Amazing! Thanks, Sir!!! ❤

    Stanislav Shelemekh May 27, 2020 3:18 am Reply
  • aha I knew if I spent countless hours watching your videos that I could extract some voodoo magic from Android… this is some badass voodoo magic here…
    combined with the include in views… man I can't even imagine all the stuff that we can create…

    Matt Graves May 27, 2020 3:18 am Reply
  • Well how to hide loading animation when file is loaded..?
    Plzz replying

    TECHNOMATRY May 27, 2020 3:18 am Reply
  • Thanks a lot sir <3

    Moaz El-sawaf May 27, 2020 3:18 am Reply
  • Great tutorial

    Piero Linares May 27, 2020 3:18 am Reply
  • Whoever left a thumbsdown must be really jealous of you. Hervorragend. Absolut lobenswert.

    slash0t5 May 27, 2020 3:18 am Reply
  • Thanks!How can I make this smoother?

    XYZERTUBE May 27, 2020 3:18 am Reply
  • Thanks Man!!!!!!

    Joshua Douce May 27, 2020 3:18 am Reply
  • Great job! Thanks a lot!

    Şaban KARACA May 27, 2020 3:18 am Reply
  • Thank you very much.

    Atheesh Rathnaweera May 27, 2020 3:18 am Reply
  • Sir you are a *GOOD TEACHER*.
    But tell me how to use with WebView

    MOHAN LAL CHOUDHARY May 27, 2020 3:18 am 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!

    VISWESWARAN 1998 May 27, 2020 3:18 am 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….

    Muhammad Tahir May 27, 2020 3:18 am Reply
  • Thanks 🙂

    Aninu Apps May 27, 2020 3:18 am Reply
  • How to use it in dialog?

    Pree Nxus May 27, 2020 3:18 am 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

    Clark Wu May 27, 2020 3:18 am Reply
  • What a great tutorial. Thanks!!!

    Clark Wu May 27, 2020 3:18 am Reply
  • Is this Java?

    GabriellaMZ May 27, 2020 3:18 am Reply
  • How to display progress inside ring, if our progress is set to 30% then I also want to display this 30% inside ring?

    Muhammad Tariq May 27, 2020 3:18 am Reply
  • Very helpful 🙂

    Robert` DROP TABLE Students - - May 27, 2020 3:18 am Reply
  • Arigatou Sensei

    Al Rey Panilagao May 27, 2020 3:18 am Reply
  • This dude, is a boss. Fight me.

    Eagle E May 27, 2020 3:18 am 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%"?

    roul3688 May 27, 2020 3:18 am Reply
  • Sir , how to change progressbar color from default color .

    moin May 27, 2020 3:18 am Reply
  • superb video (Y)

    hashir hasan May 27, 2020 3:18 am Reply
  • Hi cloud u show how can i make this show negative progress ?

    Alexander Scorpion May 27, 2020 3:18 am Reply

Leave a Reply

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