santhosh
santhosh

Reputation: 1

How to do carousel animation in Android?

I have some images, i want it to rotate like circularly in a Carousel fashion. please let me know how to do it in android platform if anybody knows...

Upvotes: 0

Views: 2465

Answers (2)

pgsandstrom
pgsandstrom

Reputation: 14399

This code will rotate a view 360 degrees:

RotateAnimation rotateAnimation = new RotateAnimation(360,0);
rotateAnimation.setDuration(ROTATE_TIME);
myView.startAnimation(rotateAnimation);

To make it repeat:

anim.setRepeatCount(Animation.INFINITE);

If you want the movement to have an even speed through the entire animation, check out this question that I asked a few month ago:

Make ScaleAnimation move evenly, or figure out how it moves

Upvotes: 1

kzotin
kzotin

Reputation: 5365

You can use ViewFlipper with couple of ImageViews inside.

Upvotes: 1

Related Questions