create

@NonNull
open fun create(@NonNull spec: @NonNull String, physicalPixelDisplaySizeRatio: Float, displayWidth: Int, displayHeight: Int): @NonNull DisplayShapeCompat

Creates a DisplayShapeCompat from an SVG path specification string.

Return

A DisplayShapeCompat instance.

Parameters

spec

The SVG path data string.

physicalPixelDisplaySizeRatio

The ratio of physical pixels to logical pixels.

displayWidth

The width of the display in pixels.

displayHeight

The height of the display in pixels.


@NonNull
open fun create(displayWidth: Int, displayHeight: Int, isCircular: Boolean, topLeftRadius: Int, topRightRadius: Int, bottomRightRadius: Int, bottomLeftRadius: Int): @NonNull DisplayShapeCompat

Creates a DisplayShapeCompat representing a rectangle with potentially rounded corners or a circular shape. This is used for API levels below 34.

Return

A DisplayShapeCompat instance.

Parameters

displayWidth

The width of the display in pixels.

displayHeight

The height of the display in pixels.

isCircular

Whether the display is circular

topLeftRadius

The radius of the top-left corner in pixels.

topRightRadius

The radius of the top-right corner in pixels.

bottomRightRadius

The radius of the bottom-right corner in pixels.

bottomLeftRadius

The radius of the bottom-left corner in pixels.