The second Android 11 Developer Preview is now available, test it out and share your feedback.

androidx.ui.foundation.shape.corner

Classes

CornerBasedShape

Base class for Shapes defined by four CornerSizes.

CutCornerShape

A shape describing the rectangle with cut corners.

RoundedCornerShape

A shape describing the rectangle with rounded corners.

Top-level functions summary

CornerSize
CornerSize(size: Dp)

Creates CornerSize with provided size.

CornerSize
CornerSize(size: Px)

Creates CornerSize with provided size.

CornerSize
CornerSize(percent: Int)

Creates CornerSize with provided size.

CornerSize
CornerSize(percent: Float)

Creates CornerSize with provided size.

CutCornerShape

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

CutCornerShape

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

CutCornerShape

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

CutCornerShape
CutCornerShape(percent: Int)

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

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

Creates CutCornerShape with sizes defined in Dp.

CutCornerShape
CutCornerShape(topLeft: Px = 0.px, topRight: Px = 0.px, bottomRight: Px = 0.px, bottomLeft: Px = 0.px)

Creates CutCornerShape with sizes defined in Px.

CutCornerShape
CutCornerShape(topLeftPercent: Int = 0, topRightPercent: Int = 0, bottomRightPercent: Int = 0, bottomLeftPercent: Int = 0)

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

RoundedCornerShape

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

RoundedCornerShape

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

RoundedCornerShape

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

RoundedCornerShape

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

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

Creates RoundedCornerShape with sizes defined in Dp.

RoundedCornerShape
RoundedCornerShape(topLeft: Px = 0.px, topRight: Px = 0.px, bottomRight: Px = 0.px, bottomLeft: Px = 0.px)

Creates RoundedCornerShape with sizes defined in Px.

RoundedCornerShape
RoundedCornerShape(topLeftPercent: Int = 0, topRightPercent: Int = 0, bottomRightPercent: Int = 0, bottomLeftPercent: Int = 0)

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

Top-level properties summary

RoundedCornerShape

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

CornerSize

CornerSize always equals to zero.

Top-level functions

CornerSize

fun CornerSize(size: Dp): CornerSize

Creates CornerSize with provided size.

Parameters
size: Dp the corner size defined in Dp.

CornerSize

fun CornerSize(size: Px): CornerSize

Creates CornerSize with provided size.

Parameters
size: Px the corner size defined in Px.

CornerSize

fun CornerSize(percent: Int): CornerSize

Creates CornerSize with provided size.

Parameters
percent: Int the corner size defined in percents of the shape's smaller side. Can't be negative or larger then 50 percents.

CornerSize

fun CornerSize(percent: Float): CornerSize

Creates CornerSize with provided size.

Parameters
percent: Float the corner size defined in float percents of the shape's smaller side. Can't be negative or larger then 50 percents.

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(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: Px): CutCornerShape

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

Parameters
size: Px Size in Px 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.

CutCornerShape

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

Creates CutCornerShape with sizes defined in Dp.

CutCornerShape

fun CutCornerShape(
    topLeft: Px = 0.px,
    topRight: Px = 0.px,
    bottomRight: Px = 0.px,
    bottomLeft: Px = 0.px
): CutCornerShape

Creates CutCornerShape with sizes defined in Px.

CutCornerShape

fun CutCornerShape(
    topLeftPercent: Int = 0,
    topRightPercent: Int = 0,
    bottomRightPercent: Int = 0,
    bottomLeftPercent: Int = 0
): CutCornerShape

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

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(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: Px): RoundedCornerShape

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

Parameters
size: Px Size in Px 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(
    topLeft: Dp = 0.dp,
    topRight: Dp = 0.dp,
    bottomRight: Dp = 0.dp,
    bottomLeft: Dp = 0.dp
): RoundedCornerShape

Creates RoundedCornerShape with sizes defined in Dp.

RoundedCornerShape

fun RoundedCornerShape(
    topLeft: Px = 0.px,
    topRight: Px = 0.px,
    bottomRight: Px = 0.px,
    bottomLeft: Px = 0.px
): RoundedCornerShape

Creates RoundedCornerShape with sizes defined in Px.

RoundedCornerShape

fun RoundedCornerShape(
    topLeftPercent: Int = 0,
    topRightPercent: Int = 0,
    bottomRightPercent: Int = 0,
    bottomLeftPercent: Int = 0
): RoundedCornerShape

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

Top-level properties

CircleShape

val CircleShape: RoundedCornerShape

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

ZeroCornerSize

val ZeroCornerSize: CornerSize

CornerSize always equals to zero.