Is there a way to set and run xml animation-list as an xml attribute? I can install and run it programmatically as follows:
ImageView img = (ImageView) findViewById(R.id.loadingImageView); img.setBackgroundResource(R.drawable.loading_animation); AnimationDrawable frameAnimation = (AnimationDrawable) img.getBackground(); frameAnimation.start();
Animation List:
<animation-list xmlns:android="http://schemas.android.com/apk/res/android" //... android:oneshot="false" > <item android:drawable="@drawable/loading_anim_frame_one" android:duration="50"/> <item android:drawable="@drawable/loading_anim_frame_two" android:duration="50"/>
and so on.
Is there a way to do this with xml only markup, i.e. no java code?
If not, is there a way to at least set it as an xml attribute and then run it programmatically?
I cannot use the rotation of a single drawable, since the animation consists of several sequences in a sequence.
source share