Я работаю над приложением для Android.Мне нужно запустить вторую анимацию, когда происходит первая анимация.
Мне нужно перемещать изображения одно за другим через некоторое время.Я использовал framelayout с двумя imageViews в main.xml.
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView android:src="@drawable/ars1"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/imageView2">
</ImageView>
<ImageView android:src="@drawable/ars"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/imageView1">
</ImageView>
</FrameLayout>
Ниже приведен мой animation.xml:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator">
<translate android:fromXDelta="100%p" android:toXDelta="-100%p"
android:duration="1500" />
</set>
в методе oncreate моего класса активности, я делаю что-то вродениже которого не работает.
ImageView imageView1;
ImageView imageView2;
Animation tranOut;
tranOut = AnimationUtils.loadAnimation(this, R.anim.animation);
imageView1 = (ImageView)findViewById(R.id.imageView1);
imageView1.setAnimation(tranOut);
imageView2 = (ImageView)findViewById(R.id.imageView2);
imageView2.setAnimation(tranOut);
Скажите, пожалуйста, как я могу перемещать два изображения одно за другим?
Спасибо, Jyoti