RoundedCornerShape

Function

Common
fun RoundedCornerShape(corner: CornerSize) = RoundedCornerShape(corner, corner, corner, corner)

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

Parameters

cornerCornerSize to apply.
Common
fun RoundedCornerShape(size: Dp) = RoundedCornerShape(CornerSize(size))

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

Parameters

sizeSize in Dp to apply.
Common
fun RoundedCornerShape(size: Float) = RoundedCornerShape(CornerSize(size))

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

Parameters

sizeSize in pixels to apply.
Common
fun RoundedCornerShape(percent: Int) = RoundedCornerShape(CornerSize(percent))

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

Parameters

percentSize in percents to apply.
Common
fun RoundedCornerShape(
    topStart: Dp = 0.dp,
    topEnd: Dp = 0.dp,
    bottomEnd: Dp = 0.dp,
    bottomStart: Dp = 0.dp,
) =
    RoundedCornerShape(
        topStart = CornerSize(topStart),
        topEnd = CornerSize(topEnd),
        bottomEnd = CornerSize(bottomEnd),
        bottomStart = CornerSize(bottomStart),
    )

Creates RoundedCornerShape with sizes defined in Dp.

Common
fun RoundedCornerShape(
    topStart: Float = 0.0f,
    topEnd: Float = 0.0f,
    bottomEnd: Float = 0.0f,
    bottomStart: Float = 0.0f,
) =
    RoundedCornerShape(
        topStart = CornerSize(topStart),
        topEnd = CornerSize(topEnd),
        bottomEnd = CornerSize(bottomEnd),
        bottomStart = CornerSize(bottomStart),
    )

Creates RoundedCornerShape with sizes defined in pixels.

Common
fun RoundedCornerShape(
    @IntRange(from = 0, to = 100) topStartPercent: Int = 0,
    @IntRange(from = 0, to = 100) topEndPercent: Int = 0,
    @IntRange(from = 0, to = 100) bottomEndPercent: Int = 0,
    @IntRange(from = 0, to = 100) bottomStartPercent: Int = 0,
) =
    RoundedCornerShape(
        topStart = CornerSize(topStartPercent),
        topEnd = CornerSize(topEndPercent),
        bottomEnd = CornerSize(bottomEndPercent),
        bottomStart = CornerSize(bottomStartPercent),
    )

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

Parameters

topStartPercentThe top start corner radius as a percentage of the smaller side, with a range of 0 - 100.
topEndPercentThe top end corner radius as a percentage of the smaller side, with a range of 0 - 100.
bottomEndPercentThe bottom end corner radius as a percentage of the smaller side, with a range of 0 - 100.
bottomStartPercentThe bottom start corner radius as a percentage of the smaller side, with a range of 0 - 100.