CorneredShape

open class CorneredShape(val topLeft: Corner = Corner.Sharp, val topRight: Corner = Corner.Sharp, val bottomRight: Corner = Corner.Sharp, val bottomLeft: Corner = Corner.Sharp) : Shape

A Shape implementation with customizable corners.

Parameters

topLeft

specifies a Corner for the top left of the Shape.

topRight

specifies a Corner for the top right of the Shape.

bottomLeft

specifies a Corner for the bottom left of the Shape.

bottomRight

specifies a Corner for the bottom right of the Shape.

Inheritors

Constructors

Link copied to clipboard
constructor(topLeft: Corner = Corner.Sharp, topRight: Corner = Corner.Sharp, bottomRight: Corner = Corner.Sharp, bottomLeft: Corner = Corner.Sharp)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open fun createPath(density: Float, path: Path, left: Float, top: Float, right: Float, bottom: Float)

Adds a contour of this CorneredShape to the provided Path.

Link copied to clipboard
open override fun drawShape(context: DrawContext, paint: Paint, path: Path, left: Float, top: Float, right: Float, bottom: Float)

Draws the Shape on the canvas.

Link copied to clipboard
fun getCornerScale(width: Float, height: Float, density: Float): Float

Returns a scale factor for the corner size, which will prevent graphical glitches in case the size of the corners is larger than the shape’s dimensions.