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

RoundedCornerShapeKt

public final class RoundedCornerShapeKt


Summary

Public methods

static final @NonNull RoundedCornerShape

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

static final @NonNull RoundedCornerShape
RoundedCornerShape(int percent)

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

static final @NonNull RoundedCornerShape

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

static final @NonNull RoundedCornerShape
RoundedCornerShape(float size)

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

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

Creates RoundedCornerShape with sizes defined in Dp.

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

Creates RoundedCornerShape with sizes defined in pixels.

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

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

static final @NonNull RoundedCornerShape

Circular Shape with all the corners sized as the 50 percent of the shape size.

Public methods

RoundedCornerShape

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

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

Parameters
@NonNull CornerSize corner

CornerSize to apply.

RoundedCornerShape

public static final @NonNull RoundedCornerShape RoundedCornerShape(int percent)

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

Parameters
int percent

Size in percents to apply.

RoundedCornerShape

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

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

Parameters
@NonNull Dp size

Size in Dp to apply.

RoundedCornerShape

public static final @NonNull RoundedCornerShape RoundedCornerShape(float size)

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

Parameters
float size

Size in pixels to apply.

RoundedCornerShape

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

Creates RoundedCornerShape with sizes defined in Dp.

RoundedCornerShape

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

Creates RoundedCornerShape with sizes defined in pixels.

RoundedCornerShape

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

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

Parameters
int topStartPercent

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

int topEndPercent

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

int bottomEndPercent

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

int bottomStartPercent

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

getCircleShape

public static final @NonNull RoundedCornerShape getCircleShape()

Circular Shape with all the corners sized as the 50 percent of the shape size.