PathInterpolator


public class PathInterpolator implements Interpolator


An interpolator that can traverse a Path that extends from Point(0, 0) to (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).

The Path must not have gaps in the x direction and must not loop back on itself such that there can be two points sharing the same x coordinate. It is alright to have a disjoint line in the vertical direction:

    Path path = new Path();
    path.lineTo(0.25f, 0.25f);
    path.moveTo(0.25f, 0.5f);
    path.lineTo(1f, 1f);

Summary

Public constructors

Create an interpolator for an arbitrary Path.

PathInterpolator(float controlX, float controlY)

Create an interpolator for a quadratic Bezier curve.

PathInterpolator(
    @NonNull Context context,
    @Nullable AttributeSet attrs,
    @NonNull XmlPullParser parser
)

Create an interpolator from XML.

PathInterpolator(
    float controlX1,
    float controlY1,
    float controlX2,
    float controlY2
)

Create an interpolator for a cubic Bezier curve.

PathInterpolator(
    @NonNull Resources res,
    @Nullable Resources.Theme theme,
    @Nullable AttributeSet attrs,
    @NonNull XmlPullParser parser
)

Create an interpolator from XML.

Public methods

float
getInterpolation(@FloatRange(from = 0, to = 1) float input)

Using the line in the Path in this interpolator that can be described as y = f(x), finds the y coordinate of the line given t as the x coordinate.

Public constructors

<h3 id="PathInterpolator(android.graphics.Path)" data-text="Path