I’ve been scratching my head over this for a long time now and searched for an answer without any luck!
It seems to be trivial, but as far as I know, it isn’t.
I use a listview in my Android application where every item (view) displays a spinning ProgressBar before the
content is loaded and displayed (the content is retrieved through http calls and json, so it may take a while to process).
The problem is that the spinning progress bars rotates independently of each other, thus creating the effect of a whirling
chaos instead of a syncronised row of good-looking loading markers.
I’ve tried everything i could come up with… not recycling the ProgressBar in getView()… have only one instance of the same ProgressBar…
resetting the ProgressBars android:progress whenever the list items gets visible (via onScroll() in the activity)… etc,
but since they start to spin in creation time (when getView gets called in the adapter) they will never have the same cycle sync.

Any suggestions are welcome!
EDIT: Now works perfectly! – inserted animation listener call setStartOffset() back to 0 after the first repeat so that it doesn’t keep “jumping” randomly.
I found a working solution for this issue, which works by timing the animation to the current system milliseconds. It’s a bit of a hack, as it uses reflection to get the
mAnimationfield inProgressBar. That being said, this field has remained in place in the Android sources since it was created (works up to 4.2).Create the
android.widget.SyncedProgressBarclass, and use it instead ofProgressBarin your .xml files. It essentially makes the animation start at the beginning of the animation duration. You can also play around withsetDuration(500)to verify that it works (the progress wheel will spin really quickly). Hope this helps!