Skip to content

Most visited

Recently visited

navigation
added in version 22.1.0
belongs to Maven artifact com.android.support:support-compat:27.0.0

PathInterpolatorCompat

public final class PathInterpolatorCompat
extends Object

java.lang.Object
   ↳ android.support.v4.view.animation.PathInterpolatorCompat


Helper for creating path-based Interpolator instances. On API 21 or newer, the platform implementation will be used and on older platforms a compatible alternative implementation will be used.

Summary

Public methods

static Interpolator create(Path path)

Create an Interpolator for an arbitrary Path.

static Interpolator create(float controlX1, float controlY1, float controlX2, float controlY2)

Create an Interpolator for a cubic Bezier curve.

static Interpolator create(float controlX, float controlY)

Create an Interpolator for a quadratic Bezier curve.

Inherited methods

From class java.lang.Object

Public methods

create

added in version 22.1.0
Interpolator create (Path path)

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).

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.

Parameters
path Path: the Path to use to make the line representing the Interpolator

Returns
Interpolator the Interpolator representing the Path

create

added in version 22.1.0
Interpolator create (float controlX1, 
                float controlY1, 
                float controlX2, 
                float controlY2)

Create an Interpolator for a cubic Bezier curve. The end points (0, 0) and (1, 1) are assumed.

Parameters
controlX1 float: the x coordinate of the first control point of the cubic Bezier

controlY1 float: the y coordinate of the first control point of the cubic Bezier

controlX2 float: the x coordinate of the second control point of the cubic Bezier

controlY2 float: the y coordinate of the second control point of the cubic Bezier

Returns
Interpolator the Interpolator representing the cubic Bezier curve

create

added in version 22.1.0
Interpolator create (float controlX, 
                float controlY)

Create an Interpolator for a quadratic Bezier curve. The end points (0, 0) and (1, 1) are assumed.

Parameters
controlX float: the x coordinate of the quadratic Bezier control point

controlY float: the y coordinate of the quadratic Bezier control point

Returns
Interpolator the Interpolator representing the quadratic Bezier curve

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)