I need to do a animation with two interpolators, for example the animation have 1 seconde of duration for 0 sec to 0.5 sec uses accelerate interpolaor ans for 0.5 to 1 sec use bounce interpolator.
have a way for to do this?
You can try something like this:
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<translate
android:interpolator="@android:anim/bounce_interpolator"
android:fromYDelta="0%p"
android:toYDelta="100"
android:duration="500"/>
<translate
android:interpolator = "@android:anim/accelerate_interpolator"
android:fromYDelta="100"
android:toYDelta="100"
android:fromXDelta="0"
android:toXDelta="100"
android:startOffset="500"
android:duration="1000"/>
</set>
This uses two interpolators
, the first one is a bounce that moves a view for halve a second. And the second interpolator
is an accelerate interpolator
that moves a view to the right after halve a second has passed, for a duration of one second. Therefore with a total animation time of 1 second. Hope that helps.
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