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

CutCornerShapeKt

public final class CutCornerShapeKt


Summary

Public methods

static final @NonNull CutCornerShape

Creates CutCornerShape with the same size applied for all four corners.

static final @NonNull CutCornerShape
CutCornerShape(int percent)

Creates CutCornerShape with the same size applied for all four corners.

static final @NonNull CutCornerShape

Creates CutCornerShape with the same size applied for all four corners.

static final @NonNull CutCornerShape
CutCornerShape(float size)

Creates CutCornerShape with the same size applied for all four corners.

static final @NonNull CutCornerShape
CutCornerShape(
    @NonNull Dp topStart,
    @NonNull Dp topEnd,
    @NonNull Dp bottomEnd,
    @NonNull Dp bottomStart
)

Creates CutCornerShape with sizes defined in Dp.

static final @NonNull CutCornerShape
CutCornerShape(
    float topStart,
    float topEnd,
    float bottomEnd,
    float bottomStart
)

Creates CutCornerShape with sizes defined in float.

static final @NonNull CutCornerShape
CutCornerShape(
    int topStartPercent,
    int topEndPercent,
    int bottomEndPercent,
    int bottomStartPercent
)

Creates CutCornerShape with sizes defined in percents of the shape's smaller side.

Public methods

CutCornerShape

public static final @NonNull CutCornerShape CutCornerShape(@NonNull CornerSize corner)

Creates CutCornerShape with the same size applied for all four corners.

Parameters
@NonNull CornerSize corner

CornerSize to apply.

CutCornerShape

public static final @NonNull CutCornerShape CutCornerShape(int percent)

Creates CutCornerShape with the same size applied for all four corners.

Parameters
int percent

Size in percents to apply.

CutCornerShape

public static final @NonNull CutCornerShape CutCornerShape(@NonNull Dp size)

Creates CutCornerShape with the same size applied for all four corners.

Parameters
@NonNull Dp size

Size in Dp to apply.

CutCornerShape

public static final @NonNull CutCornerShape CutCornerShape(float size)

Creates CutCornerShape with the same size applied for all four corners.

Parameters
float size

Size in pixels to apply.

CutCornerShape

public static final @NonNull CutCornerShape CutCornerShape(
    @NonNull Dp topStart,
    @NonNull Dp topEnd,
    @NonNull Dp bottomEnd,
    @NonNull Dp bottomStart
)

Creates CutCornerShape with sizes defined in Dp.

CutCornerShape

public static final @NonNull CutCornerShape CutCornerShape(
    float topStart,
    float topEnd,
    float bottomEnd,
    float bottomStart
)

Creates CutCornerShape with sizes defined in float.

CutCornerShape

public static final @NonNull CutCornerShape CutCornerShape(
    int topStartPercent,
    int topEndPercent,
    int bottomEndPercent,
    int bottomStartPercent
)

Creates CutCornerShape with sizes defined in percents of the shape's smaller side.

Parameters
int topStartPercent

The top start corner clip size as a percentage of the smaller side, with a range of 0 - 100.

int topEndPercent

The top end corner clip size as a percentage of the smaller side, with a range of 0 - 100.

int bottomEndPercent

The bottom end clip size radius as a percentage of the smaller side, with a range of 0 - 100.

int bottomStartPercent

The bottom start clip size radius as a percentage of the smaller side, with a range of 0 - 100.