AnticipateInterpolatorpublic class AnticipateInterpolator extends BaseInterpolator implements com.android.internal.view.animation.NativeInterpolatorFactoryAn interpolator where the change starts backward then flings forward. |
Fields Summary |
---|
private final float | mTension |
Constructors Summary |
---|
public AnticipateInterpolator()
mTension = 2.0f;
| public AnticipateInterpolator(float tension)
mTension = tension;
| public AnticipateInterpolator(android.content.Context context, android.util.AttributeSet attrs)
this(context.getResources(), context.getTheme(), attrs);
| public AnticipateInterpolator(android.content.res.Resources res, android.content.res.Resources.Theme theme, android.util.AttributeSet attrs)
TypedArray a;
if (theme != null) {
a = theme.obtainStyledAttributes(attrs, R.styleable.AnticipateInterpolator, 0, 0);
} else {
a = res.obtainAttributes(attrs, R.styleable.AnticipateInterpolator);
}
mTension = a.getFloat(R.styleable.AnticipateInterpolator_tension, 2.0f);
setChangingConfiguration(a.getChangingConfigurations());
a.recycle();
|
Methods Summary |
---|
public long | createNativeInterpolator()
return NativeInterpolatorFactoryHelper.createAnticipateInterpolator(mTension);
| public float | getInterpolation(float t)
// a(t) = t * t * ((tension + 1) * t - tension)
return t * t * ((mTension + 1) * t - mTension);
|
|