I have a circular image button that I would like to animate in the following manner, zoom the button to 1.5 times its size quickly and then zoom it out with a bouncy effect.
For this I am trying to create an animation set with 2 scale animations in it and then calling it with Animation anim = AnimationUtils.loadAnimation(context, R.anim.button); view.startAnimation(anim);
but it plays only once even if I set the repeatDuration="infinte"
in the set.
How can I play multiple animations on a view in sequence infinitely? Any help appreciated.
The button.xml anim is,
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:ordering="sequentially"
android:repeatDuration="infinite"
android:shareInterpolator="false">
<scale
android:interpolator="@android:anim/linear_interpolator"
android:fromXScale="1.0"
android:toXScale="1.1"
android:fromYScale="1.0"
android:toYScale="1.0"
android:duration="2000"
android:pivotX="50%"
android:pivotY="50%" />
<scale
android:interpolator="@android:anim/bounce_interpolator"
android:fromXScale="1.1"
android:fromYScale="1.1"
android:toXScale="1.0"
android:toYScale="1.0"
android:pivotX="50%"
android:pivotY="50%"
android:duration="2000"
android:startOffset="2000" />
</set>