belongs to Maven artifact androidx.core:core:1.0.0-alpha1

DisplayCutoutCompat

public final class DisplayCutoutCompat
extends Object

java.lang.Object
   ↳ androidx.core.view.DisplayCutoutCompat


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

DisplayCutoutCompat instances are immutable.

Summary

Public constructors

DisplayCutoutCompat(Rect safeInsets, List<Rect> boundingRects)

Creates a DisplayCutout instance.

Public methods

boolean equals(Object o)
List<Rect> getBoundingRects()

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

int getSafeInsetBottom()

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

int getSafeInsetLeft()

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

int getSafeInsetRight()

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

int getSafeInsetTop()

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

int hashCode()
String toString()

Inherited methods

Public constructors

DisplayCutoutCompat

DisplayCutoutCompat (Rect safeInsets, 
                List<Rect> boundingRects)

Creates a DisplayCutout instance.

Parameters
safeInsets Rect: the insets from each edge which avoid the display cutout as returned by getSafeInsetTop() etc.

boundingRects List: the bounding rects of the display cutouts as returned by getBoundingRects() ()}.

Public methods

equals

boolean equals (Object o)

Parameters
o Object

Returns
boolean

getBoundingRects

List<Rect> getBoundingRects ()

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.

Returns
List<Rect> a list of bounding Rects, one for each display cutout area.

getSafeInsetBottom

int getSafeInsetBottom ()

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

Returns
int

getSafeInsetLeft

int getSafeInsetLeft ()

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

Returns
int

getSafeInsetRight

int getSafeInsetRight ()

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

Returns
int

getSafeInsetTop

int getSafeInsetTop ()

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

Returns
int

hashCode

int hashCode ()

Returns
int

toString

String toString ()

Returns
String