8

I'm working on a custom indeterminate spinner, I browsed through the SDK for some pointers and found the indeterminate spinner xml file made by Google:

<?xml version="1.0" encoding="utf-8"?>
<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/spinner_black_16"
android:pivotX="50%"
android:pivotY="50%"
android:framesCount="12"
android:frameDuration="100" />

When I use this as a drawable in my own project I get errors about android:framesCount and android:framesDuration. After looking on Google for a while I found this link to an issue report.

My questions is: Is there any workaround so i can still use android:framesCount and android:framesDuration? Or is there any other way I can make my custom spinner rotate smooth?

Indrek Kõue
  • 6,449
  • 8
  • 37
  • 69
Bart
  • 769
  • 2
  • 13
  • 29

2 Answers2

1

Have you looked at the answer to this question? How to make a smooth image rotation in Android It appears that you are having the same issue. He doesn't use the following:

android:framesCount="12" android:frameDuration="100"

Since it appears to be internal I would recommend going about it the way he did.

Hope this helps.

Community
  • 1
  • 1
bytebender
  • 7,371
  • 2
  • 31
  • 54
1

I replaced animated-rotate with rotate

<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/ic_loading"
android:pivotX="50%"
android:pivotY="50%" />
Pavel Poley
  • 5,307
  • 4
  • 35
  • 66