All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.simonvt.menudrawer.PeekInterpolator Maven / Gradle / Ivy

The newest version!
package net.simonvt.menudrawer;

import android.view.animation.Interpolator;

class PeekInterpolator implements Interpolator {

    private static final String TAG = "PeekInterpolator";

    private static final SinusoidalInterpolator SINUSOIDAL_INTERPOLATOR = new SinusoidalInterpolator();

    @Override
    public float getInterpolation(float input) {
        float result;

        if (input < 1.f / 3.f) {
            result = SINUSOIDAL_INTERPOLATOR.getInterpolation(input * 3);

        } else if (input > 2.f / 3.f) {
            final float val = ((input + 1.f / 3.f) - 1.f) * 3.f;
            result = 1.f - SINUSOIDAL_INTERPOLATOR.getInterpolation(val);

        } else {
            result = 1.f;
        }

        return result;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy