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

RoundedCornerShape

public final class RoundedCornerShape extends CornerBasedShape

java.lang.Object
   ↳ androidx.compose.foundation.shape.CornerBasedShape
     ↳ androidx.compose.foundation.shape.RoundedCornerShape

A shape describing the rectangle with rounded corners.

This shape will automatically mirror the corner sizes in LayoutDirection.Rtl, use AbsoluteRoundedCornerShape for the layout direction unaware version of this shape.

Summary

Public constructors

RoundedCornerShape(
    @NonNull CornerSize topStart,
    @NonNull CornerSize topEnd,
    @NonNull CornerSize bottomEnd,
    @NonNull CornerSize bottomStart
)

Public methods

@NonNull RoundedCornerShape
copy(
    @NonNull CornerSize topStart,
    @NonNull CornerSize topEnd,
    @NonNull CornerSize bottomEnd,
    @NonNull CornerSize bottomStart
)

Creates a copy of this Shape with a new corner sizes.

@NonNull Outline
createOutline(
    @NonNull Size size,
    float topStart,
    float topEnd,
    float bottomEnd,
    float bottomStart,
    @NonNull LayoutDirection layoutDirection
)

Creates Outline of this shape for the given size.

boolean
equals(Object other)
int
@NonNull String

Inherited methods

From androidx.compose.foundation.shape.CornerBasedShape
final @NonNull CornerBasedShape

Creates a copy of this Shape with a new corner size.

final @NonNull Outline
createOutline(
    @NonNull Size size,
    @NonNull LayoutDirection layoutDirection,
    @NonNull Density density
)

Creates Outline of this shape for the given size.

final @NonNull CornerSize

a size of the bottom end corner

final @NonNull CornerSize

a size of the bottom start corner

final @NonNull CornerSize

a size of the top end corner

final @NonNull CornerSize

a size of the top start corner

Public constructors

RoundedCornerShape

public RoundedCornerShape(
    @NonNull CornerSize topStart,
    @NonNull CornerSize topEnd,
    @NonNull CornerSize bottomEnd,
    @NonNull CornerSize bottomStart
)
Parameters
@NonNull CornerSize topStart

a size of the top start corner

@NonNull CornerSize topEnd

a size of the top end corner

@NonNull CornerSize bottomEnd

a size of the bottom end corner

@NonNull CornerSize bottomStart

a size of the bottom start corner

Public methods

copy

public @NonNull RoundedCornerShape copy(
    @NonNull CornerSize topStart,
    @NonNull CornerSize topEnd,
    @NonNull CornerSize bottomEnd,
    @NonNull CornerSize bottomStart
)

Creates a copy of this Shape with a new corner sizes.

Parameters
@NonNull CornerSize topStart

a size of the top start corner

@NonNull CornerSize topEnd

a size of the top end corner

@NonNull CornerSize bottomEnd

a size of the bottom end corner

@NonNull CornerSize bottomStart

a size of the bottom start corner

createOutline

public @NonNull Outline createOutline(
    @NonNull Size size,
    float topStart,
    float topEnd,
    float bottomEnd,
    float bottomStart,
    @NonNull LayoutDirection layoutDirection
)

Creates Outline of this shape for the given size.

Parameters
@NonNull Size size

the size of the shape boundary.

float topStart

the resolved size of the top start corner

float topEnd

the resolved size for the top end corner

float bottomEnd

the resolved size for the bottom end corner

float bottomStart

the resolved size for the bottom start corner

@NonNull LayoutDirection layoutDirection

the current layout direction.

equals

public boolean equals(Object other)

hashCode

public int hashCode()

toString

public @NonNull String toString()