{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

CornerRadiusKt

public final class CornerRadiusKt


Summary

Public methods

static final @NonNull CornerRadius
CornerRadius(float x, float y)

Constructs a Radius with the given x and y parameters for the size of the radius along the x and y axis respectively.

static final @NonNull CornerRadius
lerp(
    @NonNull CornerRadius start,
    @NonNull CornerRadius stop,
    float fraction
)

Linearly interpolate between two radii.

Public methods

CornerRadius

public static final @NonNull CornerRadius CornerRadius(float x, float y)

Constructs a Radius with the given x and y parameters for the size of the radius along the x and y axis respectively. By default the radius along the Y axis matches that of the given x-axis unless otherwise specified. Negative radii values are clamped to 0.

lerp

public static final @NonNull CornerRadius lerp(
    @NonNull CornerRadius start,
    @NonNull CornerRadius stop,
    float fraction
)

Linearly interpolate between two radii.

The fraction argument represents position on the timeline, with 0.0 meaning that the interpolation has not started, returning start (or something equivalent to start), 1.0 meaning that the interpolation has finished, returning stop (or something equivalent to stop), and values in between meaning that the interpolation is at the relevant point on the timeline between start and stop. The interpolation can be extrapolated beyond 0.0 and 1.0, so negative values and values greater than 1.0 are valid (and can easily be generated by curves).

Values for fraction are usually obtained from an Animation, such as an AnimationController.