androidx.compose.foundation.shape

Interfaces

CornerSize

Defines size of a corner in pixels.

Cmn

Classes

AbsoluteCutCornerShape

A shape describing the rectangle with cut corners.

Cmn
AbsoluteRoundedCornerShape

A shape describing the rectangle with rounded corners.

Cmn
CornerBasedShape

Base class for Shapes defined by four CornerSizes.

Cmn
CutCornerShape

A shape describing the rectangle with cut corners.

Cmn
GenericShape

Creates Shape defined by applying the provided builder on a Path.

Cmn
RoundedCornerShape

A shape describing the rectangle with rounded corners.

Cmn

Top-level functions summary

AbsoluteCutCornerShape

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

Cmn
AbsoluteCutCornerShape

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

Cmn
AbsoluteCutCornerShape

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

Cmn
AbsoluteCutCornerShape

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

Cmn
AbsoluteCutCornerShape
AbsoluteCutCornerShape(
    topLeft: Dp,
    topRight: Dp,
    bottomRight: Dp,
    bottomLeft: Dp
)

Creates AbsoluteCutCornerShape with sizes defined in Dp.

Cmn
AbsoluteCutCornerShape
AbsoluteCutCornerShape(
    topLeft: Float,
    topRight: Float,
    bottomRight: Float,
    bottomLeft: Float
)

Creates AbsoluteCutCornerShape with sizes defined in float.

Cmn
AbsoluteCutCornerShape
AbsoluteCutCornerShape(
    topLeftPercent: @IntRange(from = 0, to = 100) Int,
    topRightPercent: @IntRange(from = 0, to = 100) Int,
    bottomRightPercent: @IntRange(from = 0, to = 100) Int,
    bottomLeftPercent: @IntRange(from = 0, to = 100) Int
)

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

Cmn
AbsoluteRoundedCornerShape

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

Cmn
AbsoluteRoundedCornerShape

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

Cmn
AbsoluteRoundedCornerShape

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

Cmn
AbsoluteRoundedCornerShape

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

Cmn
AbsoluteRoundedCornerShape
AbsoluteRoundedCornerShape(
    topLeft: Dp,
    topRight: Dp,
    bottomRight: Dp,
    bottomLeft: Dp
)

Creates AbsoluteRoundedCornerShape with sizes defined in Dp.

Cmn
AbsoluteRoundedCornerShape
AbsoluteRoundedCornerShape(
    topLeft: Float,
    topRight: Float,
    bottomRight: Float,
    bottomLeft: Float
)

Creates AbsoluteRoundedCornerShape with sizes defined in pixels.

Cmn
AbsoluteRoundedCornerShape
AbsoluteRoundedCornerShape(
    topLeftPercent: @IntRange(from = 0, to = 100) Int,
    topRightPercent: @IntRange(from = 0, to = 100) Int,
    bottomRightPercent: @IntRange(from = 0, to = 100) Int,
    bottomLeftPercent: @IntRange(from = 0, to = 100) Int
)

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

Cmn
CornerSize
CornerSize(percent: @IntRange(from = 0, to = 100) Int)

Creates CornerSize with provided size.

Cmn
CornerSize
CornerSize(size: Dp)

Creates CornerSize with provided size.

Cmn
CornerSize

Creates CornerSize with provided size.

Cmn
CutCornerShape

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

Cmn
CutCornerShape
CutCornerShape(percent: Int)

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

Cmn
CutCornerShape

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

Cmn
CutCornerShape

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

Cmn
CutCornerShape
CutCornerShape(topStart: Dp, topEnd: Dp, bottomEnd: Dp, bottomStart: Dp)

Creates CutCornerShape with sizes defined in Dp.

Cmn
CutCornerShape
CutCornerShape(
    topStart: Float,
    topEnd: Float,
    bottomEnd: Float,
    bottomStart: Float
)

Creates CutCornerShape with sizes defined in float.

Cmn
CutCornerShape
CutCornerShape(
    topStartPercent: @IntRange(from = 0, to = 100) Int,
    topEndPercent: @IntRange(from = 0, to = 100) Int,
    bottomEndPercent: @IntRange(from = 0, to = 100) Int,
    bottomStartPercent: @IntRange(from = 0, to = 100) Int
)

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

Cmn
RoundedCornerShape

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

Cmn
RoundedCornerShape

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

Cmn
RoundedCornerShape

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

Cmn
RoundedCornerShape

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

Cmn
RoundedCornerShape
RoundedCornerShape(topStart: Dp, topEnd: Dp, bottomEnd: Dp, bottomStart: Dp)

Creates RoundedCornerShape with sizes defined in Dp.

Cmn
RoundedCornerShape
RoundedCornerShape(
    topStart: Float,
    topEnd: Float,
    bottomEnd: Float,
    bottomStart: Float
)

Creates RoundedCornerShape with sizes defined in pixels.

Cmn
RoundedCornerShape
RoundedCornerShape(
    topStartPercent: @IntRange(from = 0, to = 100) Int,
    topEndPercent: @IntRange(from = 0, to = 100) Int,
    bottomEndPercent: @IntRange(from = 0, to = 100) Int,
    bottomStartPercent: @IntRange(from = 0, to = 100) Int
)

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

Cmn

Top-level properties summary

RoundedCornerShape

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

Cmn
CornerSize

CornerSize always equals to zero.

Cmn

Top-level functions

AbsoluteCutCornerShape

fun AbsoluteCutCornerShape(corner: CornerSize): AbsoluteCutCornerShape

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

Parameters
corner: CornerSize

CornerSize to apply.

AbsoluteCutCornerShape

fun AbsoluteCutCornerShape(percent: Int): AbsoluteCutCornerShape

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

Parameters
percent: Int

Size in percents to apply.

AbsoluteCutCornerShape

fun AbsoluteCutCornerShape(size: Dp): AbsoluteCutCornerShape

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

Parameters
size: Dp

Size in Dp to apply.

AbsoluteCutCornerShape

fun AbsoluteCutCornerShape(size: Float): AbsoluteCutCornerShape

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

Parameters
size: Float

Size in pixels to apply.

AbsoluteCutCornerShape

fun AbsoluteCutCornerShape(
    topLeft: Dp = 0.dp,
    topRight: Dp = 0.dp,
    bottomRight: Dp = 0.dp,
    bottomLeft: Dp = 0.dp
): AbsoluteCutCornerShape

Creates AbsoluteCutCornerShape with sizes defined in Dp.

AbsoluteCutCornerShape

fun AbsoluteCutCornerShape(
    topLeft: Float = 0.0f,
    topRight: Float = 0.0f,
    bottomRight: Float = 0.0f,
    bottomLeft: Float = 0.0f
): AbsoluteCutCornerShape

Creates AbsoluteCutCornerShape with sizes defined in float.

AbsoluteCutCornerShape

fun AbsoluteCutCornerShape(
    topLeftPercent: @IntRange(from = 0, to = 100) Int = 0,
    topRightPercent: @IntRange(from = 0, to = 100) Int = 0,
    bottomRightPercent: @IntRange(from = 0, to = 100) Int = 0,
    bottomLeftPercent: @IntRange(from = 0, to = 100) Int = 0
): AbsoluteCutCornerShape

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

Parameters
topLeftPercent: @IntRange(from = 0, to = 100) Int = 0

The top left corner clip size as a percentage of the smaller side, with a range of 0 - 100.

topRightPercent: @IntRange(from = 0, to = 100) Int = 0

The top right corner clip size as a percentage of the smaller side, with a range of 0 - 100.

bottomRightPercent: @IntRange(from = 0, to = 100) Int = 0

The bottom right clip size radius as a percentage of the smaller side, with a range of 0 - 100.

bottomLeftPercent: @IntRange(from = 0, to = 100) Int = 0

The bottom left clip size radius as a percentage of the smaller side, with a range of 0 - 100.

AbsoluteRoundedCornerShape

fun AbsoluteRoundedCornerShape(corner: CornerSize): AbsoluteRoundedCornerShape

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

Parameters
corner: CornerSize

CornerSize to apply.

AbsoluteRoundedCornerShape

fun AbsoluteRoundedCornerShape(percent: Int): AbsoluteRoundedCornerShape

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

Parameters
percent: Int

Size in percents to apply.

AbsoluteRoundedCornerShape

fun AbsoluteRoundedCornerShape(size: Dp): AbsoluteRoundedCornerShape

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

Parameters
size: Dp

Size in Dp to apply.

AbsoluteRoundedCornerShape

fun AbsoluteRoundedCornerShape(size: Float): AbsoluteRoundedCornerShape

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

Parameters
size: Float

Size in pixels to apply.

AbsoluteRoundedCornerShape

fun AbsoluteRoundedCornerShape(
    topLeft: Dp = 0.dp,
    topRight: Dp = 0.dp,
    bottomRight: Dp = 0.dp,
    bottomLeft: Dp = 0.dp
): AbsoluteRoundedCornerShape

Creates AbsoluteRoundedCornerShape with sizes defined in Dp.

AbsoluteRoundedCornerShape

fun AbsoluteRoundedCornerShape(
    topLeft: Float = 0.0f,
    topRight: Float = 0.0f,
    bottomRight: Float = 0.0f,
    bottomLeft: Float = 0.0f
): AbsoluteRoundedCornerShape

Creates AbsoluteRoundedCornerShape with sizes defined in pixels.

AbsoluteRoundedCornerShape

fun AbsoluteRoundedCornerShape(
    topLeftPercent: @IntRange(from = 0, to = 100) Int = 0,
    topRightPercent: @IntRange(from = 0, to = 100) Int = 0,
    bottomRightPercent: @IntRange(from = 0, to = 100) Int = 0,
    bottomLeftPercent: @IntRange(from = 0, to = 100) Int = 0
): AbsoluteRoundedCornerShape

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

Parameters
topLeftPercent: @IntRange(from = 0, to = 100) Int = 0

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

topRightPercent: @IntRange(from = 0, to = 100) Int = 0

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

bottomRightPercent: @IntRange(from = 0, to = 100) Int = 0

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

bottomLeftPercent: @IntRange(from = 0, to = 100) Int = 0

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

CornerSize

fun CornerSize(percent: @IntRange(from = 0, to = 100) Int): CornerSize

Creates CornerSize with provided size.

Parameters
percent: @IntRange(from = 0, to = 100) Int

the corner size defined in percents of the shape's smaller side. Can't be negative or larger then 100 percents.

fun CornerSize(size: Dp): CornerSize

Creates CornerSize with provided size.

Parameters
size: Dp

the corner size defined in Dp.

CornerSize

fun CornerSize(size: Float): CornerSize

Creates CornerSize with provided size.

Parameters
size: Float

the corner size defined in pixels.

CutCornerShape

fun CutCornerShape(corner: CornerSize): CutCornerShape

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

Parameters
corner: CornerSize

CornerSize to apply.

CutCornerShape

fun CutCornerShape(percent: Int): CutCornerShape

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

Parameters
percent: Int

Size in percents to apply.

fun CutCornerShape(size: Dp): CutCornerShape

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

Parameters
size: Dp

Size in Dp to apply.

CutCornerShape

fun CutCornerShape(size: Float): CutCornerShape

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

Parameters
size: Float

Size in pixels to apply.

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

Creates CutCornerShape with sizes defined in Dp.

CutCornerShape

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

Creates CutCornerShape with sizes defined in float.

CutCornerShape

fun CutCornerShape(
    topStartPercent: @IntRange(from = 0, to = 100) Int = 0,
    topEndPercent: @IntRange(from = 0, to = 100) Int = 0,
    bottomEndPercent: @IntRange(from = 0, to = 100) Int = 0,
    bottomStartPercent: @IntRange(from = 0, to = 100) Int = 0
): CutCornerShape

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

Parameters
topStartPercent: @IntRange(from = 0, to = 100) Int = 0

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

topEndPercent: @IntRange(from = 0, to = 100) Int = 0

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

bottomEndPercent: @IntRange(from = 0, to = 100) Int = 0

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

bottomStartPercent: @IntRange(from = 0, to = 100) Int = 0

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

RoundedCornerShape

fun RoundedCornerShape(corner: CornerSize): RoundedCornerShape

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

Parameters
corner: CornerSize

CornerSize to apply.

RoundedCornerShape

fun RoundedCornerShape(percent: Int): RoundedCornerShape

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

Parameters
percent: Int

Size in percents to apply.

RoundedCornerShape

fun RoundedCornerShape(size: Dp): RoundedCornerShape

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

Parameters
size: Dp

Size in Dp to apply.

RoundedCornerShape

fun RoundedCornerShape(size: Float): RoundedCornerShape

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

Parameters
size: Float

Size in pixels to apply.

RoundedCornerShape

fun RoundedCornerShape(
    topStart: Dp = 0.dp,
    topEnd: Dp = 0.dp,
    bottomEnd: Dp = 0.dp,
    bottomStart: Dp = 0.dp
): RoundedCornerShape

Creates RoundedCornerShape with sizes defined in Dp.

RoundedCornerShape

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

Creates RoundedCornerShape with sizes defined in pixels.

RoundedCornerShape

fun RoundedCornerShape(
    topStartPercent: @IntRange(from = 0, to = 100) Int = 0,
    topEndPercent: @IntRange(from = 0, to = 100) Int = 0,
    bottomEndPercent: @IntRange(from = 0, to = 100) Int = 0,
    bottomStartPercent: @IntRange(from = 0, to = 100) Int = 0
): RoundedCornerShape

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

Parameters
topStartPercent: @IntRange(from = 0, to = 100) Int = 0

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

topEndPercent: @IntRange(from = 0, to = 100) Int = 0

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

bottomEndPercent: @IntRange(from = 0, to = 100) Int = 0

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

bottomStartPercent: @IntRange(from = 0, to = 100) Int = 0

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

Top-level properties

CircleShape

val CircleShapeRoundedCornerShape

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

ZeroCornerSize

val ZeroCornerSizeCornerSize

CornerSize always equals to zero.