CornerRadius

data class CornerRadius(    var topLeftX: Float,     var topLeftY: Float,     var topRightX: Float,     var topRightY: Float,     var bottomRightX: Float,     var bottomRightY: Float,     var bottomLeftX: Float,     var bottomLeftY: Float)

Corner radius configuration.

Parameters

topLeftX

Top left radius for x-axis.

topLeftY

Top left radius for y-axis.

topRightX

Top right radius for x-axis.

topRightY

Top right radius for y-axis.

bottomRightX

Bottom right radius for x-axis.

bottomRightY

Bottom right radius for y-axis.

bottomLeftX

Bottom left radius for x-axis.

bottomLeftY

Bottom left radius for y-axis.

Constructors

Link copied to clipboard
fun CornerRadius(radius: Float)

Corner radius configuration.

Link copied to clipboard
fun CornerRadius(radius: Pair<Float, Float>)

Corner radius configuration.

Link copied to clipboard
fun CornerRadius(    topLeft: Float,     topRight: Float,     bottomRight: Float,     bottomLeft: Float)

Corner radius configuration.

Link copied to clipboard
fun CornerRadius(    topLeftX: Float,     topLeftY: Float,     topRightX: Float,     topRightY: Float,     bottomRightX: Float,     bottomRightY: Float,     bottomLeftX: Float,     bottomLeftY: Float)

Functions

Link copied to clipboard
fun asDpToPx(context: Context): CornerRadius

Interprets that the current values are expressed in density-independent pixels (dp) and converts them to pixels (px) according to the device screen density.

Link copied to clipboard
fun toRadii(): FloatArray

Converts the corner radius values to radii (array of 8 values, 4 pairs of (X,Y))

Properties

Link copied to clipboard
var bottomLeftX: Float
Link copied to clipboard
var bottomLeftY: Float
Link copied to clipboard
var bottomRightX: Float
Link copied to clipboard
var bottomRightY: Float
Link copied to clipboard
var topLeftX: Float
Link copied to clipboard
var topLeftY: Float
Link copied to clipboard
var topRightX: Float
Link copied to clipboard
var topRightY: Float