Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom spinner animation not smooth enough: framesCount and frameDuration error

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?

like image 850
Bart Avatar asked Apr 04 '12 12:04

Bart


2 Answers

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.

like image 154
bytebender Avatar answered Nov 14 '22 23:11

bytebender


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%" />
like image 34
Pavel Poley Avatar answered Nov 15 '22 00:11

Pavel Poley