mardi 3 février 2015

How to start Translate Animation in random order in Android?

I have 3 Translate Animation to be played when the app starts -



Animation animation = new TranslateAnimation(0, 0, -1500, 1500);
animation.setDuration(1000);
animation.setFillAfter(false);
myimage.startAnimation(animation);
animation.setRepeatCount(Animation.INFINITE);

Animation animation2 = new TranslateAnimation(0, 0, -1000, 1000);
animation2.setDuration(1000);
animation2.setFillAfter(false);
myimage2.startAnimation(animation2);
animation2.setRepeatCount(Animation.INFINITE);

Animation animation3 = new TranslateAnimation(0, 0, -500, 500);
animation3.setDuration(1000);
animation3.setFillAfter(false);
myimage3.startAnimation(animation3);
animation3.setRepeatCount(Animation.INFINITE);


I want to start the above 3 in random order, not necessarily the first one first.


One full day gone and I'm still unable to find a solution. Any pointers on how to achieve it ?





Aucun commentaire:

Enregistrer un commentaire