Gradually increase/decrease animation speed? [Android] -
i working on animated effect on android, know if there's other way gradually increase/decrease animation speed?
is possible specify first 3 second rate of change slow, , rest goes fast?
use interpolator. case recommend acceleratedecelerateinterpolator
animation anim = animationutils.loadanimation(this, r.anim.your_animation); anim.setinterpolator(new acceleratedecelerateinterpolator()); image.startanimation(anim);
as interpolator, can build own!
public class myinterpolator extends interpolator { public myinterpolator(int valuecount) { super(valuecount); } public float getinterpolation (float input) { return (float)(math.cos((input + 1) * math.pi) / 2.0f) + 0.5f; } }
using wolfram alpha can play parameters.