HI friends,

I want to slide the images from right to left and  stay for some time and
then left to right.
I used translate animation.
Below is my code:

int drawableImages[] = { R.drawable.img1, R.drawable.img2, R.drawable.img3,
R.drawable.img4, R.drawable.img5, R.drawable.img6, R.drawable.img7 };
imgView = (ImageView) findViewById(R.id.picMain11);
imgView.postDelayed(new Runnable() {
public void run() {
Animation anim = new TranslateAnimation(0, -500, 0, 0);
imgView.setImageResource(R.drawable.img6);
anim.setDuration(2000);
anim.setFillAfter(true);
imgView.startAnimation(anim);
anim.setAnimationListener(new ImageAnimListener());

}
}, 2000);



private class ImageAnimListener implements AnimationListener {
int z = 0;
Animation anim=null;
public void onAnimationEnd(Animation animation) {

  anim = new TranslateAnimation(800, -1000, 0, 0);
 imgView.setImageResource(drawableImages[z]);
anim.setDuration(5000);
imgView.startAnimation(anim);
anim.setFillAfter(true);
anim.setRepeatMode(1);
anim.setAnimationListener(ImageAnimListener.this);


}

public void onAnimationRepeat(Animation animation) {

}

public void onAnimationStart(Animation animation) {
System.out.println("ANIMATION START ");
z++;
if(z==drawableImages.length-1)
z=0;
}

}

The problem is after sliding from right to left image is not staying for
some time and then before the next image comes there is a black screen in
between..

How to solve this?Is there any better way to do this?

Please respond with clues.
-- 
Thanks,
Vani Reddy

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to