0

I have two images side by side I want to animate them to make a pulse like animation. My question is how do I do it so that they alternate between each other as follows:

duration is 8 min---->

  • image 1 triggered for 20 sec while image 2 waits
  • image 2 triggered for the next 20 sec while image 1 waits
  • image 1 triggered again for 20 sec while image 2 waits
  • and so on until the 8 min are over.

My issue isn't with the animation itself. It's with triggering the animation at these specific times while my timer is counting down.

a_local_nobody
  • 7,947
  • 5
  • 29
  • 51
  • 1
    show what you have tried so far – snachmsm Nov 10 '20 at 13:33
  • Well the the thing is I haven't tried because I don't know what methods or tools I'm supposed to use. I've been looking around so far, most of what comes up in my searches involves an alarm. So basically I want someone to point me to the right direction, I'll manage. – Mohamed El Kayal Nov 10 '20 at 13:54
  • that kind of questions are in fact forbidden, SO is for helping in resolving bugs and weird behavior, not suggesting whole solutions or HOWTOs.. – snachmsm Nov 10 '20 at 13:56

1 Answers1

1

check out AnimationSet - you can query multiple Animations in there and every animation can have own start delay, duration, repeat mode etc. check this SO for some samples

or

simply make two Animations for each View. start one for 20 secs and attach listener - when it ends then start another anim, and so on. HERE you can find some overview of animations API

PS. "pulse like animation" seems like scaleX and scaleY animation

snachmsm
  • 17,866
  • 3
  • 32
  • 74