Navaneeth Sen
Navaneeth Sen

Reputation: 6486

Slideshow in android

I am seeking some pointers on how to create a sideshow application in Android. I need to have the Android transition animation when I switch between the images.

Upvotes: 1

Views: 1702

Answers (1)

Abhinav
Abhinav

Reputation: 39942

You can fade the images in and out (or probably use other transitions) using the Animation classes in Android. Here is something which I use

Animation animation = new AlphaAnimation(1.0f, 0.0f);
animation.setDuration(100);
animation.setRepeatCount(0);
animation.setFillAfter(true); 
myView.startAnimation(animation)

Then load the other image when this completes. You can use an AnimationListener to detect the animation end.

After the animation do the same thing but reverse the alpha values in AlphaAnimation.

Upvotes: 2

Related Questions