PathEasing

Class

Common
public class PathEasing(private val path: Path) : Easing

An easing function 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 be continuous along the x axis. The Path should also be monotonically increasing along the x axis. If the Path is not monotonic and there are multiple y values for a given x, the chosen y value is implementation dependent and may vary.

The Path must not contain any Path.close command as it would force the path to restart from the beginning.

This is equivalent to the Android PathInterpolator.

CubicBezierEasing should be used if a single bezier curve is required as it performs fewer allocations. PathEasing should be used when creating an arbitrary path.

Note: a PathEasing instance can be used from any thread, but not concurrently.

Parameters

pathThe Path to use to make the curve representing the easing curve.