0

I have 6 ImageButton. I applied the same animation to all of them as below:

Animation anim1 = AnimationUtils.loadAnimation(this, R.anim.wave_scale);
img1.startAnimation(anim1);
img2.startAnimation(anim1);
img3.startAnimation(anim1);
img4.startAnimation(anim1);
img5.startAnimation(anim1);
img6.startAnimation(anim1);

Now, I want to hav a free small time between one animation and the other (let's say 200 ms), so that they will not start at the same time. I tried to add this.wait(200) between each of the startAnimation methods but this didn't work.

Any solution ?

iTurki
  • 16,292
  • 20
  • 87
  • 132

2 Answers2

0

The temporary solution that I found until now is:

  1. You need to re-define the same animation for each ImageView. Strange !
  2. Before you assign it to an ImageView, you will setStartOffset() for your animation by whatever you want.

Wired But works fine !

Thanks.

iTurki
  • 16,292
  • 20
  • 87
  • 132
-1

try this: img1.setStartOffset(700); This will create a delay of 700 millsec before animation starts

peter_budo
  • 1,748
  • 4
  • 26
  • 48
ShineDown
  • 1,881
  • 3
  • 21
  • 29
  • Did you read the question? This is NOT what I want! I said in the question: `I want to have a free small time between one animation and the other`. – iTurki Jul 13 '11 at 05:48
  • 1
    BTW, setStartOffset is for animation, not Views ! – iTurki Jul 13 '11 at 06:22