Save animation frame by frame

1

I have a frame by frame animation in xml. My question is whether it is possible to save it in shared preferences and how to do it.

Thank you.

<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="true">

<item android:drawable="@drawable/imagen1" android:duration="85"/>
<item android:drawable="@drawable/imagen2" android:duration="85"/>
<item android:drawable="@drawable/imagen3" android:duration="85"/>
<item android:drawable="@drawable/imagen4" android:duration="85"/>
<item android:drawable="@drawable/imagen5" android:duration="85"/>
<item android:drawable="@drawable/imagen6" android:duration="85"/>
<item android:drawable="@drawable/imagen7" android:duration="85"/>
<item android:drawable="@drawable/imagen8" android:duration="85"/>
<item android:drawable="@drawable/imagen9" android:duration="85"/>
<item android:drawable="@drawable/imagen10" android:duration="85"/>

</animation-list>
    
asked by Zekirak 06.12.2016 в 17:49
source

1 answer

1

It is not necessary to save your animation in Shared preferences, simply add the file in the folder /anim (if it does not exist you can create it), this within the resource directory /res :

This way you can use your animation, accessing it from the folder /res/anim :

Animation myAnimacion = AnimationUtils.loadAnimation(this, R.anim.my_animacion);
    
answered by 06.12.2016 / 18:16
source