DisplayShapeCompat


class DisplayShapeCompat


Compatibility class for representing the physical shape of a display.

This class can be used to obtain a Path representing the display's shape, which can be useful for drawing or layout purposes, especially on devices with non-rectangular displays (e.g., circular or displays with rounded corners).

Instances of DisplayShapeCompat can be created in a few ways:

  • Using create to parse an SVG path data string. This is suitable for custom or complex display shapes.
  • Using create to define a common shape, such as a circle or a rectangle with specified corner radii.
The Path representing the shape can be retrieved using getPath.

Summary

Public functions

Boolean
equals(o: Any?)
Path

Returns a Path of the display shape.

Int
String

Public functions

equals

fun equals(o: Any?): Boolean

getPath

fun getPath(): Path

Returns a Path of the display shape. Returns an empty Path if the shape information is not available or if parsing fails.

Throws
java.lang.IllegalArgumentException

If the display spec string cannot be parsed.

hashCode

fun hashCode(): Int

toString

fun toString(): String