ExpandedRoundedCornerShape

@Immutable
data class ExpandedRoundedCornerShape(val topStart: CornerSize, val topEnd: CornerSize, val bottomEnd: CornerSize, val bottomStart: CornerSize, val cornerExpansion: Dp) : Shape

A shape describing a rectangle with rounded corners, where each corner radius is expanded by an additional amount specified by cornerExpansion.

This shape is useful when you need to create rounded corners that account for additional spacing, such as when applying borders with insets. The cornerExpansion value is added to each corner's radius, ensuring that the rounded corners maintain their visual appearance even when the shape needs to be adjusted for spacing requirements.

Since

0.5.0

Parameters

topStart

The size of the top start corner radius.

topEnd

The size of the top end corner radius.

bottomEnd

The size of the bottom end corner radius.

bottomStart

The size of the bottom start corner radius.

cornerExpansion

The additional length to apply to each corner radius. This value is added to the base corner radius for all four corners.

Constructors

Link copied to clipboard
constructor(topStart: CornerSize, topEnd: CornerSize, bottomEnd: CornerSize, bottomStart: CornerSize, cornerExpansion: Dp)

Properties

Link copied to clipboard
val bottomEnd: CornerSize
Link copied to clipboard
val bottomStart: CornerSize
Link copied to clipboard
Link copied to clipboard
val topEnd: CornerSize
Link copied to clipboard
val topStart: CornerSize

Functions

Link copied to clipboard
open override fun createOutline(size: Size, layoutDirection: LayoutDirection, density: Density): Outline
Link copied to clipboard

Checks if this Shape is a RoundedCornerShape.

Link copied to clipboard
fun Shape.toExpandedCornerShapeOrSelf(cornerExpansion: Dp): Shape

Converts this Shape to an ExpandedRoundedCornerShape if it is a RoundedCornerShape, otherwise returns the shape unchanged.