Class

CornerBasedShape

Base class for [Shape]s defined by four [CornerSize]s.

Common
abstract class CornerBasedShape(
    val topStart: CornerSize,
    val topEnd: CornerSize,
    val bottomEnd: CornerSize,
    val bottomStart: CornerSize,
) : Shape, Interpolatable

Base class for Shapes defined by four CornerSizes.

Parameters

topStart a size of the top start corner
topEnd a size of the top end corner
bottomEnd a size of the bottom end corner
bottomStart a size of the bottom start corner

Functions

createOutline

abstract fun createOutline(
        size: Size,
        topStart: Float,
        topEnd: Float,
        bottomEnd: Float,
        bottomStart: Float,
        layoutDirection: LayoutDirection,
    ): Outline

Creates Outline of this shape for the given size.

Parameters

size the size of the shape boundary.
topStart the resolved size of the top start corner
topEnd the resolved size for the top end corner
bottomEnd the resolved size for the bottom end corner
bottomStart the resolved size for the bottom start corner
layoutDirection the current layout direction.

copy

abstract fun copy(
        topStart: CornerSize = this.topStart,
        topEnd: CornerSize = this.topEnd,
        bottomEnd: CornerSize = this.bottomEnd,
        bottomStart: CornerSize = this.bottomStart,
    ): CornerBasedShape

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

Parameters

topStart a size of the top start corner
topEnd a size of the top end corner
bottomEnd a size of the bottom end corner
bottomStart a size of the bottom start corner

copy

fun copy(all: CornerSize): CornerBasedShape

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

Parameters

all a size to apply for all four corners