android circle progressbar

10,443

There is no way to stop indeterminate progress bar. Either you will have to create your own custom progress bar or you can do small tricks with indeterminate drawable.

You can have an imageview over progress bar and set the same drawable in it.

When you want to stop the animation, hide progress bar and show image view.

When you want to start animation, hide image view and show progress bar.

It should give you same effect.

Share:
10,443
Adam
Author by

Adam

Updated on June 25, 2022

Comments

  • Adam
    Adam about 2 years

    I need to make a circle progress bar, which rotate only while data is receiving. I wrote in layout:

            <ProgressBar
                android:id="@+id/progress_bar"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:indeterminateOnly="true"
                style="?android:attr/progressBarStyleSmall"
                />
    

    And then the part of data was received, I do

    mProgressBar.incrementProgressBy(10);
    

    I thought that initially mProgressBar should be stopped, but it is rotating permanently, even than connection is not established!

    What should I do to make ProgressBar initially stopped & and rotating while another part of data was received?