Example usage for android.support.v4.view.animation PathInterpolatorCompat create

List of usage examples for android.support.v4.view.animation PathInterpolatorCompat create

Introduction

In this page you can find the example usage for android.support.v4.view.animation PathInterpolatorCompat create.

Prototype

public static Interpolator create(Path path) 

Source Link

Document

Create an Interpolator for an arbitrary Path .

Usage

From source file:net.yanzm.actionbarprogress.MaterialIndeterminateProgressDrawable.java

public MaterialIndeterminateProgressDrawable(int trackColor, int accentColor) {
    this.trackColor = trackColor;
    this.accentColor = accentColor;

    {//w w  w  .j  av  a  2s . c  om
        Path path = new Path();
        path.moveTo(0, 0);
        path.cubicTo(0.0375f, 0f, 0.128764607715f, 0.0895380946618f, 0.25f, 0.218553507947f);
        path.cubicTo(0.322410320025f, 0.295610602487f, 0.436666666667f, 0.417591408114f, 0.483333333333f,
                0.489826169306f);
        path.cubicTo(0.69f, 0.80972296795f, 0.793333333333f, 0.950016125212f, 1.0f, 1.0f);
        translateInterpolator2 = PathInterpolatorCompat.create(path);
    }
    {
        Path path = new Path();
        path.moveTo(0, 0);
        path.cubicTo(0.06834272400867f, 0.01992566661414f, 0.19220331656133f, 0.15855429260523f,
                0.33333333333333f, 0.34926160892842f);
        path.cubicTo(0.38410433133433f, 0.41477913453861f, 0.54945792615267f, 0.68136029463551f,
                0.66666666666667f, 0.68279962777002f);
        path.cubicTo(0.752586273196f, 0.68179620963216f, 0.737253971954f, 0.878896194318f, 1f, 1f);
        scaleInterpolator2 = PathInterpolatorCompat.create(path);
    }
    {
        Path path = new Path();
        path.moveTo(0, 0);
        path.lineTo(0.2f, 0f);
        path.cubicTo(0.3958333333336f, 0.0f, 0.474845090492f, 0.206797621729f, 0.5916666666664f,
                0.417082932942f);
        path.cubicTo(0.7151610251224f, 0.639379624869f, 0.81625f, 0.974556908664f, 1.0f, 1.0f);
        translateInterpolator1 = PathInterpolatorCompat.create(path);
    }
    {
        Path path = new Path();
        path.moveTo(0, 0);
        path.lineTo(0.3665f, 0f);
        path.cubicTo(0.47252618112021f, 0.062409910275f, 0.61541608570164f, 0.5f, 0.68325f, 0.5f);
        path.cubicTo(0.75475061236836f, 0.5f, 0.75725829093844f, 0.814510098964f, 1f, 1f);
        scaleInterpolator1 = PathInterpolatorCompat.create(path);
    }
}

From source file:com.savvasdalkitsis.betwixt.Interpolators.java

/**
 * <strong>ANDROID INTERPOLATOR</strong><br/><br/>
 * Create an Interpolator for an arbitrary Path. The Path must begin at (0, 0) and end at
 * (1, 1). The x-coordinate along the Path is the input value and the output is the y
 * coordinate of the line at that point. This means that the Path must conform to a function y = f(x).
 * @param path the Path to use to make the line representing the Interpolator
 *//* ww  w .ja v  a  2s .c o  m*/
@NonNull
public static Interpolator path(Path path) {
    return PathInterpolatorCompat.create(path);
}