ACarter ACarter - 3 months ago 7
Android Question

Set the interpolator for android animations in Java

This seems very simple: I'm trying to set the interpolator to be used for an animation in my App. I need to set this in the Java code, not the XML (It will change according to various things).

From the android website, I've found

setInterpolator()


However, I'm not sure how to use this.

I've tried just feeding in the interpolar name (ie.
BounceIterpolator
), but this did nothing.

I tried
R.anim.BounceIterpolator
, but Intellisense said
anim cannot be resolved or is not a field
.

So how can I set the interpolator from the Java?

Answer
setInterpolator(new BounceInterpolator());
Comments