How to implement an activity progress bar

Inman

Well-Known Member
Licensed User
Longtime User
Normally we use a progress bar to indicate a progress. If we do not have definite values, we set the indeterminate value as true and display a spinning wheel. It is called Activity circle.

There is another type of indeterminate progress called Activity bar, which is used by many Google apps.

progress_activity.png


It is a horizontal bar but without any starting or ending point to show the progress and will keep on going until we clear it.

Progress & Activity | Android Developers

How can we implement this?
 

derez

Expert
Licensed User
Longtime User
The problem of the regular progressbar is that it needs "doevent" every cycle of the loop that hasn't ended yet, and while doing so it slows down the performance of the loop.

If you'll look here http://www.b4x.com/forum/additional...it-instead-progressdialogshow.html#post149659 you'll see that I made a class with the ability to define the rate of doevents (to a slower rate then the loop's rate), so the performance is less effected.
I don't know of a way just to put this on and then off, it must be included in some for-next or do while/until loops.
The display involved is much more complicated then what you ask for - this can be done with moving few labels .
 
Upvote 0
Top