What are the limitations of animation-list in Android/Xamarin?
I've tried a simple example with 10 frames, less than 200kb each and I still get Out of Memory errors. I've also tried this library but I get a Bitmap decode error.
TestActivity.xaml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/myLayout"
android:clipChildren="false">
<ImageView
android:id="@+id/myAnimation"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:adjustViewBounds="true"
android:src="@anim/TestAnimation"
android:scaleType="centerInside" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:paddingLeft="10dp"
android:paddingRight="20dp"
android:paddingTop="170dp"
android:paddingBottom="100dp"
android:clipChildren="false"
android:clipToPadding="false">
<ImageButton
android:id="@+id/triggerAnimation"
android:layout_height="20dp"
android:layout_width="60dp"
android:background="@android:color/transparent"
android:adjustViewBounds="false"
android:src="@drawable/myButton"
android:scaleType="fitXY"
android:padding="0dp"/>
</LinearLayout>
</RelativeLayout>
TestAnimation.xml:
<?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/test0000" android:duration="33" />
<item android:drawable="@drawable/test0001" android:duration="33" />
<item android:drawable="@drawable/test0002" android:duration="33" />
<item android:drawable="@drawable/test0003" android:duration="33" />
<item android:drawable="@drawable/test0004" android:duration="33" />
<item android:drawable="@drawable/test0005" android:duration="33" />
<item android:drawable="@drawable/test0006" android:duration="33" />
<item android:drawable="@drawable/test0007" android:duration="33" />
<item android:drawable="@drawable/test0008" android:duration="33" />
<item android:drawable="@drawable/test0009" android:duration="33" />
<item android:drawable="@drawable/test0010" android:duration="33" />
TestActivity.cs (only animation trigger code is shown):
var imgView = FindViewById<ImageView>(Resource.Id.myAnimation);
AnimationDrawable animation = (AnimationDrawable)imgView.Drawable;
animation.Start();