EasingFunction.CubicBezier


public final class EasingFunction.CubicBezier extends EasingFunction


Parameters for a custom cubic Bezier easing function.

A cubic Bezier is generally defined by four points, P0 - P3. In the case of the easing function, P0 is defined to be the point (0, 0), and P3 is defined to be the point (1, 1). The values of x1 and x2 are required to be in the range 0, 1. This guarantees that the resulting curve is a function with respect to x and follows the CSS specification

Valid parameters must have all finite values, and x1 and x2 must be in the interval 0, 1.

Input x values that are outside the interval 0, 1 will be clamped, but output values will not. This is somewhat different from the w3c defined cubic Bezier that allows extrapolated values outside x in 0, 1 by following end-point tangents.

Summary

Public constructors

CubicBezier(
    @FloatRange(from = 0.0, to = 1.0) float x1,
    float y1,
    @FloatRange(from = 0.0, to = 1.0) float x2,
    float y2
)

Creates a new CubicBezier easing function.

Public methods

boolean
equals(Object other)
final @FloatRange(from = 0.0, to = 1.0) float

The x-coordinate of the first control point.

final @FloatRange(from = 0.0, to = 1.0) float

The x-coordinate of the second control point.

final float

The y-coordinate of the first control point.

final float

The y-coordinate of the second control point.

int
@NonNull String

Public constructors

CubicBezier

Added in 1.1.0-alpha03
public CubicBezier(
    @FloatRange(from = 0.0, to = 1.0) float x1,
    float y1,
    @FloatRange(from = 0.0, to = 1.0) float x2,
    float y2
)

Creates a new CubicBezier easing function.

Parameters
@FloatRange(from = 0.0, to = 1.0) float x1

The x-coordinate of the first control point. Must be in the range 0, 1.

float y1

The y-coordinate of the first control point.

@FloatRange(from = 0.0, to = 1.0) float x2

The x-coordinate of the second control point. Must be in the range 0, 1.

float y2

The y-coordinate of the second control point.

Public methods

equals

public boolean equals(Object other)

getX1

Added in 1.1.0-alpha03
public final @FloatRange(from = 0.0, to = 1.0) float getX1()

The x-coordinate of the first control point. Must be in the range 0, 1.

getX2

Added in 1.1.0-alpha03
public final @FloatRange(from = 0.0, to = 1.0) float getX2()

The x-coordinate of the second control point. Must be in the range 0, 1.

getY1

Added in 1.1.0-alpha03
public final float getY1()

The y-coordinate of the first control point.

getY2

Added in 1.1.0-alpha03
public final float getY2()

The y-coordinate of the second control point.

hashCode

public int hashCode()

toString

public @NonNull String toString()