CornerBasedShape

Class

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

Base class for Shapes defined by four CornerSizes.

Parameters

topStarta size of the top start corner
topEnda size of the top end corner
bottomEnda size of the bottom end corner
bottomStarta size of the bottom start corner

Functions

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

sizethe size of the shape boundary.
topStartthe resolved size of the top start corner
topEndthe resolved size for the top end corner
bottomEndthe resolved size for the bottom end corner
bottomStartthe resolved size for the bottom start corner
layoutDirectionthe current layout direction.
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

topStarta size of the top start corner
topEnda size of the top end corner
bottomEnda size of the bottom end corner
bottomStarta size of the bottom start corner
fun copy(all: CornerSize): CornerBasedShape

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

Parameters

alla size to apply for all four corners