Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

DisplayCutoutCompat

class DisplayCutoutCompat
kotlin.Any
   ↳ androidx.core.view.DisplayCutoutCompat

Represents the area of the display that is not functional for displaying content.

DisplayCutoutCompat instances are immutable.

Summary

Public constructors
<init>(safeInsets: Rect!, boundingRects: MutableList<Rect!>!)

Creates a DisplayCutout instance.

Public methods
Int

Boolean
equals(other: Any?)

String

Int

Returns the inset from the right which avoids the display cutout in pixels.

Int

Returns the inset from the bottom which avoids the display cutout in pixels.

Int

Returns the inset from the left which avoids the display cutout in pixels.

Int

Returns the inset from the top which avoids the display cutout in pixels.

MutableList<Rect!>!

Returns a list of Rects, each of which is the bounding rectangle for a non-functional area on the display.

Public constructors

<init>

DisplayCutoutCompat(safeInsets: Rect!, boundingRects: MutableList<Rect!>!)

Creates a DisplayCutout instance.

Parameters
safeInsets Rect!: the insets from each edge which avoid the display cutout as returned by getSafeInsetTop() etc.
boundingRects Rect!: the bounding rects of the display cutouts as returned by getBoundingRects() ()}.

Public methods

hashCode

fun hashCode(): Int

equals

fun equals(other: Any?): Boolean

toString

fun toString(): String

getSafeInsetRight

fun getSafeInsetRight(): Int

Returns the inset from the right which avoids the display cutout in pixels.

getSafeInsetBottom

fun getSafeInsetBottom(): Int

Returns the inset from the bottom which avoids the display cutout in pixels.

getSafeInsetLeft

fun getSafeInsetLeft(): Int

Returns the inset from the left which avoids the display cutout in pixels.

getSafeInsetTop

fun getSafeInsetTop(): Int

Returns the inset from the top which avoids the display cutout in pixels.

getBoundingRects

fun getBoundingRects(): MutableList<Rect!>!

Returns a list of Rects, each of which is the bounding rectangle for a non-functional area on the display. There will be at most one non-functional area per short edge of the device, and none on the long edges.

Return
MutableList<Rect!>!: a list of bounding Rects, one for each display cutout area.