Google is committed to advancing racial equity for Black communities. See how.

CornerBasedShape

abstract class CornerBasedShape : Shape
kotlin.Any
   ↳ androidx.compose.foundation.shape.CornerBasedShape

Base class for Shapes defined by four CornerSizes.

Summary

Public constructors
<init>(topLeft: CornerSize, topRight: CornerSize, bottomRight: CornerSize, bottomLeft: CornerSize)

Base class for Shapes defined by four CornerSizes.

Public methods
abstract CornerBasedShape
copy(topLeft: CornerSize = this.topLeft, topRight: CornerSize = this.topRight, bottomRight: CornerSize = this.bottomRight, bottomLeft: CornerSize = this.bottomLeft)

Creates a copy of this Shape with a new corner sizes.

CornerBasedShape

Creates a copy of this Shape with a new corner size.

Outline
createOutline(size: Size, density: Density)

Creates Outline of this shape for the given size.

abstract Outline
createOutline(size: Size, topLeft: Float, topRight: Float, bottomRight: Float, bottomLeft: Float)

Creates Outline of this shape for the given size.

open Boolean
equals(other: Any?)

open Int

Properties
CornerSize

a size of the bottom right corner

CornerSize

a size of the bottom left corner

CornerSize

a size of the top left corner

CornerSize

a size of the top right corner

Public constructors

<init>

CornerBasedShape(
    topLeft: CornerSize,
    topRight: CornerSize,
    bottomRight: CornerSize,
    bottomLeft: CornerSize)

Base class for Shapes defined by four CornerSizes.

Parameters
topLeft: CornerSize a size of the top left corner
topRight: CornerSize a size of the top right corner
bottomRight: CornerSize a size of the bottom left corner
bottomLeft: CornerSize a size of the bottom right corner

Public methods

copy

abstract fun copy(
    topLeft: CornerSize = this.topLeft,
    topRight: CornerSize = this.topRight,
    bottomRight: CornerSize = this.bottomRight,
    bottomLeft: CornerSize = this.bottomLeft
): CornerBasedShape

Creates a copy of this Shape with a new corner sizes.

Parameters
topLeft: CornerSize = this.topLeft a size of the top left corner
topRight: CornerSize = this.topRight a size of the top right corner
bottomRight: CornerSize = this.bottomRight a size of the bottom left corner
bottomLeft: CornerSize = this.bottomLeft a size of the bottom right corner

copy

fun copy(all: CornerSize): CornerBasedShape

Creates a copy of this Shape with a new corner size.

Parameters
all: CornerSize a size to apply for all four corners

createOutline

fun createOutline(
    size: Size,
    density: Density
): Outline

Creates Outline of this shape for the given size.

Parameters
size: Size the size of the shape boundary.
density: Density the current density of the screen.
Return
Outline of this shape for the given size.

createOutline

abstract fun createOutline(
    size: Size,
    topLeft: Float,
    topRight: Float,
    bottomRight: Float,
    bottomLeft: Float
): Outline

Creates Outline of this shape for the given size.

Parameters
size: Size the size of the shape boundary.
topLeft: Float the resolved size of the top left corner
topRight: Float the resolved size for the top right corner
bottomRight: Float the resolved size for the bottom left corner
bottomLeft: Float the resolved size for the bottom right corner

equals

open fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

Properties

bottomLeft

val bottomLeft: CornerSize

a size of the bottom right corner

bottomRight

val bottomRight: CornerSize

a size of the bottom left corner

topLeft

val topLeft: CornerSize

a size of the top left corner

topRight

val topRight: CornerSize

a size of the top right corner