public class ComponentPadding extends Object
After a listener is set via Window#setOnApplyComponentPaddingListener,
the callback IApplyComponentPaddingListener#notifyPaddingChange(ComponentPadding padding)
will be invoked upon padding changes. Applications will use the new padding values passed to
the callback for layout.
| 构造器 | 说明 |
|---|---|
ComponentPadding() |
A constructor used to create a
ComponentPadding instance. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
DisplayNotch |
getDisplayNotch() |
Obtain information about a display notch.
|
Rect |
getGestureRect() |
Obtain the system gesture area that can be set.
|
Rect |
getNotSettableGestureRect() |
Obtain the system gesture area that cannot be set.
|
int |
getSystemComponentPaddingBottom() |
Obtain the padding from the system window to the bottom of the screen.
|
int |
getSystemComponentPaddingLeft() |
Obtain the padding from the system window to the left of the screen.
|
int |
getSystemComponentPaddingRight() |
Obtain the padding from the system window to the right of the screen.
|
int |
getSystemComponentPaddingTop() |
Obtain the padding from the system window to the top of the screen.
|
int |
getUnchangedPaddingBottom() |
Obtain the padding from the unchanged area to the bottom of the screen.
|
int |
getUnchangedPaddingLeft() |
Obtain the padding from the unchanged area to the left of the screen.
|
int |
getUnchangedPaddingRight() |
Obtain the padding from the unchanged area to the right of the screen.
|
int |
getUnchangedPaddingTop() |
Obtain the padding from the unchanged area to the top of the screen.
|
boolean |
hasNonZeroPadding() |
Check whether there is any non-zero padding.
|
boolean |
hasSystemComponentPadding() |
Check whether there is any padding for the system window.
|
boolean |
hasUnchangedPadding() |
Check whether there is any unchanged window padding.
|
boolean |
isPaddingFullyUsed() |
Check whether padding is fully used.
|
boolean |
isRoundCorner() |
Check whether the associated window has rounded corners.
|
ComponentPadding |
useDisplayNotch() |
Clear a display notch.
|
ComponentPadding |
useSystemComponentPadding() |
Clear system component paddings.
|
ComponentPadding |
useUnchangedPadding() |
Clear an unchanged area.
|
public ComponentPadding()
ComponentPadding instance.public Rect getNotSettableGestureRect()
Rect object representing the obtained system gesture area.ohos.agp.window.view.WindowInsetsWrapper.ParameterInvalidException - Throw this exception if mWindowInsetsWrapper is invalid.public Rect getGestureRect()
Rect object representing the obtained system gesture area.ohos.agp.window.view.WindowInsetsWrapper.ParameterInvalidException - Throw this exception if mWindowInsetsWrapper is invalid.public ComponentPadding useDisplayNotch()
ComponentPadding object with the display notch cleared.ohos.agp.window.view.WindowInsetsWrapper.ParameterInvalidException - Throw this exception if mWindowInsetsWrapper is invalid.public ComponentPadding useUnchangedPadding()
In an unchanged area, padding values associated with the status bar do not change, regardless of whether the status bar is shown or hidden.
ComponentPadding object with the unchanged area cleared.ohos.agp.window.view.WindowInsetsWrapper.ParameterInvalidException - Throw this exception if mWindowInsetsWrapper is invalid.public ComponentPadding useSystemComponentPadding()
ComponentPadding object with paddings cleared.ohos.agp.window.view.WindowInsetsWrapper.ParameterInvalidException - Throw this exception if mWindowInsetsWrapper is invalid.public DisplayNotch getDisplayNotch()
DisplayNotch object.ohos.agp.window.view.WindowInsetsWrapper.ParameterInvalidException - Throw this exception if mWindowInsetsWrapper is invalid.public int getUnchangedPaddingBottom()
ohos.agp.window.view.WindowInsetsWrapper.ParameterInvalidException - Throw this exception if mWindowInsetsWrapper is invalid.public int getUnchangedPaddingLeft()
ohos.agp.window.view.WindowInsetsWrapper.ParameterInvalidException - Throw this exception if mWindowInsetsWrapper is invalid.public int getUnchangedPaddingRight()
ohos.agp.window.view.WindowInsetsWrapper.ParameterInvalidException - Throw this exception if mWindowInsetsWrapper is invalid.public int getUnchangedPaddingTop()
ohos.agp.window.view.WindowInsetsWrapper.ParameterInvalidException - Throw this exception if mWindowInsetsWrapper is invalid.public int getSystemComponentPaddingBottom()
ohos.agp.window.view.WindowInsetsWrapper.ParameterInvalidException - Throw this exception if mWindowInsetsWrapper is invalid.public int getSystemComponentPaddingLeft()
ohos.agp.window.view.WindowInsetsWrapper.ParameterInvalidException - Throw this exception if mWindowInsetsWrapper is invalid.public int getSystemComponentPaddingRight()
ohos.agp.window.view.WindowInsetsWrapper.ParameterInvalidException - Throw this exception if mWindowInsetsWrapper is invalid.public int getSystemComponentPaddingTop()
ohos.agp.window.view.WindowInsetsWrapper.ParameterInvalidException - Throw this exception if mWindowInsetsWrapper is invalid.public boolean hasNonZeroPadding()
true if non-zero padding is available; return false otherwise.ohos.agp.window.view.WindowInsetsWrapper.ParameterInvalidException - Throw this exception if mWindowInsetsWrapper is invalid.public boolean hasUnchangedPadding()
true if unchanged window padding is available; return false otherwise.ohos.agp.window.view.WindowInsetsWrapper.ParameterInvalidException - Throw this exception if mWindowInsetsWrapper is invalid.public boolean hasSystemComponentPadding()
true if padding is available for the system window; return false otherwise.ohos.agp.window.view.WindowInsetsWrapper.ParameterInvalidException - Throw this exception if mWindowInsetsWrapper is invalid.public boolean isPaddingFullyUsed()
true if padding is fully used; return false otherwise.ohos.agp.window.view.WindowInsetsWrapper.ParameterInvalidException - Throw this exception if mWindowInsetsWrapper is invalid.public boolean isRoundCorner()
true if the associated window has rounded corners; return false otherwise.ohos.agp.window.view.WindowInsetsWrapper.ParameterInvalidException - Throw this exception if mWindowInsetsWrapper is invalid.