I try to achieve a horizontal indeterminate ProgressBar, which will reverse its animation on end. To clarify, I want the progress bar to animate from 0 to 100, and afterwards back from 100 to 0. Here's a video of the standard animation, which I want to reverse on end.
According to documentation of ProgressBar this should be possible with xml, but i cannot achieve this. You can either set repeat (standard?) or cycle (this is what I want)
Here's my implementation:
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="8dip"
android:indeterminate="true"
android:indeterminateOnly="true" //tried "false" too
android:indeterminateBehavior="cycle" // type "reverse" is the one from linked video?
android:max="100" />
Tried with max-value
, and different style-parents
However, I found the value android:indeterminateDuration="[value]"
and set one to 1second, the other to 10seconds. In the end, both progressloaders had the same length, which leaves me with the thought, that the styles might be overwritten somewhere?!
Does anyone know how to fix this?
Bounty Update: Question solved, for a working example where indeterminateBehaviour is working