I am doing a scale animation with anim xml
as follows. The animation interpolator isn't working. I am trying to have bounce interpolator but isn't working.
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" > <scale android:duration="900" android:fromXScale="1" android:fromYScale="0.5" android:interpolator="@android:anim/bounce_interpolator" android:pivotX="50%" android:pivotY="0%" android:toXScale="1.0" android:toYScale="1.0" /> </set>
EDIT: Actually my whole xml is
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" > <scale android:duration="600" android:fromXScale="1" android:fromYScale="0.5" android:interpolator="@android:anim/bounce_interpolator" android:pivotX="50%" android:pivotY="0%" android:toXScale="1.0" android:toYScale="1.0" /> <alpha android:duration="@android:integer/config_longAnimTime" android:fromAlpha="0.0" android:interpolator="@android:anim/decelerate_interpolator" android:toAlpha="1.0" /> </set>
Finally got the solution. It works for me and could be helpful to others. The key was to put the android:interpolator tag in the animation set.
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/bounce_interpolator" > <scale android:duration="600" android:fromXScale="1" android:fromYScale="0.5" android:pivotX="50%" android:pivotY="0%" android:toXScale="1.0" android:toYScale="1.0" /> <alpha android:duration="600" android:fromAlpha="0.0" android:toAlpha="1.0" /> </set>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With