When the indeterminateDrawable attribute is configured using ProgressBar, the solution is to use the rotate attribute instead of the viewable one
<ProgressBar
android:id="@+id/progressBar1"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_gravity="center_horizontal"
android:indeterminateBehavior="repeat"
android:indeterminateDrawable="@drawable/ando_dialog_loading"
android:indeterminateDuration="1200"
android:indeterminateOnly="true" />
Copy the code
ando_dialog_loading.xml
<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/ic_ando_dialog_loading_circle"
android:pivotX="50%"
android:pivotY="50%"
android:fromDegrees="0"
android:toDegrees="360"/>
Copy the code
🍎 to rotate
<rotate
xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/ic_ando_dialog_loading_circle"
android:fromDegrees="0"
android:pivotX="50%"
android:pivotY="50%"
android:repeatCount="1"
android:toDegrees="360" />
Copy the code