Function

CutCornerShape

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

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free

CutCornerShape

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

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

Parameters

corner CornerSize to apply.

CutCornerShape

Common
fun CutCornerShape(size: Dp) = CutCornerShape(CornerSize(size))

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

Parameters

size Size in Dp to apply.

CutCornerShape

Common
fun CutCornerShape(size: Float) = CutCornerShape(CornerSize(size))

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

Parameters

size Size in pixels to apply.

CutCornerShape

Common
fun CutCornerShape(percent: Int) = CutCornerShape(CornerSize(percent))

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

Parameters

percent Size in percents to apply.

CutCornerShape

Common
fun CutCornerShape(
    topStart: Dp = 0.dp,
    topEnd: Dp = 0.dp,
    bottomEnd: Dp = 0.dp,
    bottomStart: Dp = 0.dp,
) =
    CutCornerShape(
        topStart = CornerSize(topStart),
        topEnd = CornerSize(topEnd),
        bottomEnd = CornerSize(bottomEnd),
        bottomStart = CornerSize(bottomStart),
    )

Creates CutCornerShape with sizes defined in Dp.


CutCornerShape

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

Creates CutCornerShape with sizes defined in float.


CutCornerShape

Common
fun CutCornerShape(
    @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,
) =
    CutCornerShape(
        topStart = CornerSize(topStartPercent),
        topEnd = CornerSize(topEndPercent),
        bottomEnd = CornerSize(bottomEndPercent),
        bottomStart = CornerSize(bottomStartPercent),
    )

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

Parameters

topStartPercent The top start corner clip size as a percentage of the smaller side, with a range of 0 - 100.
topEndPercent The top end corner clip size as a percentage of the smaller side, with a range of 0 - 100.
bottomEndPercent The bottom end clip size radius as a percentage of the smaller side, with a range of 0 - 100.
bottomStartPercent The bottom start clip size radius as a percentage of the smaller side, with a range of 0 - 100.