Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AnimationSet setInterpolator() not working wen using nineoldandroids lib

I am using Jake Wharton's nineoldandroids lib for implementing animations compatible with pre Honeycomb devices. the lib: http://nineoldandroids.com/

for some reason, setting an AnimationSet interpolator does not seem to work. I googled it and I did not find any reference to using setInterpolator() with nineoldandroids (nothing that either confirms or denies setInterpolator() support)

Does anyone know if it is supported? and if it is, is there a certain way I should use it to make it work?

Code example:

AnimatorSet set = new AnimatorSet();
set.setInterpolator(new BounceInterpolator());

set.playTogether(
        ObjectAnimator.ofFloat(view, "translationX", 100f)
);

set.setDuration(1000).start();

It does not matter what interpolator I set, it is always using AccelerateDecelerateInterpolator

like image 487
dors Avatar asked Nov 27 '12 07:11

dors


1 Answers

Late, but I just ran into the same issue.

You have to call setInterpolator() after you've added the animations (after playTogether() or similar), because it'll only apply the interpolator to animations in the AnimationSet.

like image 158
Maria Neumayer Avatar answered Nov 19 '22 04:11

Maria Neumayer