I want to change the default animation of a ProgressBar
, so I added a custom style in my theme:
styles.xml
<style name="ProgressTheme" parent="@android:style/Widget.ProgressBar.Large">
<item name="android:indeterminateDrawable">@drawable/spinner_holo_light</item>
</style>
I am calling this style inside my ProgressBar
with the following:
ProgressBar.xml
<ProgressBar
android:id="@+id/loadingProgressBar"
style="@style/ProgressTheme"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
The problem lies inside the spinner_holo_light.xml
:
If I use the following, everything works fine on devices with os 3.0+, but the progress does not rotate on older os versions:
spinner_holo_light.xml
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/spinner_76_inner_holo"
android:fromDegrees="720"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="0" />
But if I use animate-rotate
instead, the animation works on every os version, but the result is a very laggy animation.
<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/spinner_76_inner_holo"
android:fromDegrees="720"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="0" />
What do you think about it? Am I doing something wrong here?
Make transparent background of progress dialog.
Make border less progress dialog.
And customization of color of spinner of circular progress dialog.
http://pankajchunchun.wordpress.com/2011/09/10/customization-of-spinner-progress/
On older devices it is a problem when
android:fromDegrees
is bigger thanandroid:toDegress
in<rotate>
. Try swapping the values:Alternatively, you can try setting it as infinite:
The animation might be laggy on older devices. To fix this add
android:animationResolution
to the style:I Solved this Problem by Changing BackGround xml Custom format to indeterminateDrawable
And Custom Progressbar XML Code
I couldn't get it work on Samsung Galaxy S Plus even adding
I was asking something similar to your response @Tomik
Android Progress Bar slow rotation on pre HoneyComb devices
Is it smoothly on all the pre honeycomb devices for sure?