user485498
user485498

Reputation:

Multiple animations in Android

I'm just starting to get the hang of animations, tweened animations that is. I have made several imageviews with pictures rotating and moving, and its all very fun, but I don't know what the best approach for doing multiple animations is.

For example I created a LinearLayout and stuck some ImageViews in it and wrote this:

RotateAnimation imgrotate = new RotateAnimation(0,360,
           RotateAnimation.RELATIVE_TO_SELF,0.5f,
           RotateAnimation.RELATIVE_TO_SELF,0.5f);
           rotate.setDuration(2000);
           someview.setAnimation(imgrotate);
           someview.startAnimation(imgrotate);

for each imageview. So they all spin. But now I want to step it up a gear. But reaidng other sources on the net it seems some people use canvas to do animations. What is the best way?

Upvotes: 3

Views: 1402

Answers (1)

user432209
user432209

Reputation: 20167

There is no best way. You should use the simplest and most straightforward approach that gets the job done.

Canvas' are often used because developers want more specific control over how their objects are displayed on the canvas. For example, how an object gets displayed when it interacts with other objects or the user.

Upvotes: 1

Related Questions