Is there a way to have the Animation pause for a half a second?
I am trying to make an infinite animation using the TranslateAnimation API. So, I use the RepeatCount as Infinite. I also noticed that there’s a setStartOffset(...) method that covers the case when I’d like to have a delay in starting the animation. However, I can’t find a way to have a delay before each ‘restart’. Since animation is gonna happen infinite amount of times, every time the animation restarts I need to put a delay in.
Any ideas?
Thanks!!
Here is an example:
First the layout (main.xml) with an image we would like to animate:
Next one is the animation. Placed in res/anim and is called anim_img.xml. The file contains the translation animation with android:startOffset=”500″ (in millisec). This will set the offset, which is used every time animation starts:
And last but not least – the activity. Which starts the animation: