FileDocCategorySizeDatePackage
CycleInterpolator.javaAPI DocAndroid 5.1 API2378Thu Mar 12 22:22:10 GMT 2015android.view.animation

CycleInterpolator

public class CycleInterpolator extends BaseInterpolator implements com.android.internal.view.animation.NativeInterpolatorFactory
Repeats the animation for a specified number of cycles. The rate of change follows a sinusoidal pattern.

Fields Summary
private float
mCycles
Constructors Summary
public CycleInterpolator(float cycles)

        mCycles = cycles;
    
public CycleInterpolator(android.content.Context context, android.util.AttributeSet attrs)

        this(context.getResources(), context.getTheme(), attrs);
    
public CycleInterpolator(android.content.res.Resources resources, android.content.res.Resources.Theme theme, android.util.AttributeSet attrs)

hide

        TypedArray a;
        if (theme != null) {
            a = theme.obtainStyledAttributes(attrs, R.styleable.CycleInterpolator, 0, 0);
        } else {
            a = resources.obtainAttributes(attrs, R.styleable.CycleInterpolator);
        }

        mCycles = a.getFloat(R.styleable.CycleInterpolator_cycles, 1.0f);
        setChangingConfiguration(a.getChangingConfigurations());
        a.recycle();
    
Methods Summary
public longcreateNativeInterpolator()

hide

        return NativeInterpolatorFactoryHelper.createCycleInterpolator(mCycles);
    
public floatgetInterpolation(float input)

        return (float)(Math.sin(2 * mCycles * Math.PI * input));