Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
For an anroid app, Im doing infinite Translate Animation.
imageview starts first and after a delay of 1 second, imageview2 starts.

Java
Animation animation = new TranslateAnimation(0, 0, -500, 500);
animation.setDuration(4000);
imageview.startAnimation(animation);
animation.setRepeatCount(Animation.INFINITE);

Animation animation2 = new TranslateAnimation(0, 0, -500, 500);
animation2.setDuration(4000);
imageview2.startAnimation(animation2);
imageview2.setStartOffset(1000);
animation2.setRepeatCount(Animation.INFINITE);


The problem is that, after sometime imageview overlaps imageview2.
What Can I do to avoid the overlapping of 2 images ?

Any pointer would be appreciated.
Posted
Updated 1-Feb-15 0:33am
v3
Comments
Richard MacCutchan 1-Feb-15 7:08am    
You need to set the sizes and locations so that the images are kept separate from each other.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900