public class DisplayNotch extends Object
You can use the methods in this class to obtain the notch size and safe padding on a device.
| 构造器 | 说明 |
|---|---|
DisplayNotch() |
A constructor used to create a
DisplayNotch instance. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
boolean |
equals(Object object) |
Check whether this
DisplayNotch object equals a specified one. |
Rect |
getNotchRectBottom() |
Obtain the rectangular display notch at the bottom of the screen.
|
Rect |
getNotchRectLeft() |
Obtain the rectangular display notch on the left of the screen.
|
Rect |
getNotchRectRight() |
Obtain the rectangular display notch on the right of the screen.
|
List<Rect> |
getNotchRects() |
Obtain a list of
Rect objects, with each representing a rectangular display notch on the screen. |
Rect |
getNotchRectTop() |
Obtain the rectangular display notch at the top of the screen.
|
int |
getPaddingBottom() |
Obtain the safe padding from the bottom of the screen, excluding the display notch.
|
int |
getPaddingLeft() |
Obtain the safe padding from the left of the screen, excluding the display notch.
|
int |
getPaddingRight() |
Obtain the safe padding from the right of the screen, excluding the display notch.
|
int |
getPaddingTop() |
Obtain the safe padding from the top of the screen, excluding the display notch.
|
int |
hashCode() |
Obtain the hash code of this
DisplayNotch object. |
String |
toString() |
Return a string representing this
DisplayNotch object. |
public Rect getNotchRectBottom()
Rect object, in pixels.ohos.agp.window.view.DisplayCutoutWrapper.ParameterInvalidException - Throw this exception if mDisplayCutoutWrapper is null.public Rect getNotchRectLeft()
Rect object, in pixels.ohos.agp.window.view.DisplayCutoutWrapper.ParameterInvalidException - Throw this exception if mDisplayCutoutWrapper is null.public Rect getNotchRectRight()
Rect object, in pixels.ohos.agp.window.view.DisplayCutoutWrapper.ParameterInvalidException - Throw this exception if mDisplayCutoutWrapper is null.public Rect getNotchRectTop()
Rect object, in pixels.ohos.agp.window.view.DisplayCutoutWrapper.ParameterInvalidException - Throw this exception if mDisplayCutoutWrapper is null.public List<Rect> getNotchRects()
Rect objects, with each representing a rectangular display notch on the screen.Rect objects.ohos.agp.window.view.DisplayCutoutWrapper.ParameterInvalidException - Throw this exception if mDisplayCutoutWrapper is null.public int getPaddingBottom()
ohos.agp.window.view.DisplayCutoutWrapper.ParameterInvalidException - Throw this exception if mDisplayCutoutWrapper is null.public int getPaddingLeft()
ohos.agp.window.view.DisplayCutoutWrapper.ParameterInvalidException - Throw this exception if mDisplayCutoutWrapper is null.public int getPaddingRight()
ohos.agp.window.view.DisplayCutoutWrapper.ParameterInvalidException - Throw this exception if mDisplayCutoutWrapper is null.public int getPaddingTop()
ohos.agp.window.view.DisplayCutoutWrapper.ParameterInvalidException - Throw this exception if mDisplayCutoutWrapper is null.public String toString()
DisplayNotch object.public boolean equals(Object object)
DisplayNotch object equals a specified one.equals 在类中 Objectobject - Indicate the specified DisplayNotch object for comparison.true if they are equal; returns false otherwise.ohos.agp.window.view.DisplayCutoutWrapper.ParameterInvalidException - Throw this exception if mDisplayCutoutWrapper is null.Object.hashCode(),
HashMappublic int hashCode()
DisplayNotch object.hashCode 在类中 Objectohos.agp.window.view.DisplayCutoutWrapper.ParameterInvalidException - Throw this exception if mDisplayCutoutWrapper is null.Object.equals(java.lang.Object),
System.identityHashCode(java.lang.Object)