Builder
class Builder
| kotlin.Any | |
| ↳ | android.view.DisplayCutout.Builder |
A Builder class to construct a DisplayCutout instance.
Note that this is only for tests purpose. For production code, developers should always use a DisplayCutout obtained from the system.
Summary
| Public constructors | |
|---|---|
Builder()Begin building a DisplayCutout. |
|
| Public methods | |
|---|---|
| DisplayCutout |
build()Construct a new |
| DisplayCutout.Builder |
setBoundingRectBottom(boundingRectBottom: Rect)Set a bounding rectangle for a non-functional area on the display which is located on the bottom of the screen. |
| DisplayCutout.Builder |
setBoundingRectLeft(boundingRectLeft: Rect)Set a bounding rectangle for a non-functional area on the display which is located on the left of the screen. |
| DisplayCutout.Builder |
setBoundingRectRight(boundingRectRight: Rect)Set a bounding rectangle for a non-functional area on the display which is located on the right of the screen. |
| DisplayCutout.Builder |
setBoundingRectTop(boundingRectTop: Rect)Set a bounding rectangle for a non-functional area on the display which is located on the top of the screen. |
| DisplayCutout.Builder |
setCutoutPath(cutoutPath: Path)Set the cutout |
| DisplayCutout.Builder |
setSafeInsets(safeInsets: Insets)Set the safe insets. |
| DisplayCutout.Builder |
setWaterfallInsets(waterfallInsets: Insets)Set the waterfall insets of the DisplayCutout. |
Public constructors
Public methods
build
fun build(): DisplayCutout
Construct a new DisplayCutout with the set parameters.
| Return | |
|---|---|
DisplayCutout |
This value cannot be null. |
setBoundingRectBottom
fun setBoundingRectBottom(boundingRectBottom: Rect): DisplayCutout.Builder
Set a bounding rectangle for a non-functional area on the display which is located on the bottom of the screen. If not set, the default value is an empty rectangle.
| Parameters | |
|---|---|
boundingRectBottom |
Rect: This value cannot be null. |
| Return | |
|---|---|
DisplayCutout.Builder |
This value cannot be null. |
setBoundingRectLeft
fun setBoundingRectLeft(boundingRectLeft: Rect): DisplayCutout.Builder
Set a bounding rectangle for a non-functional area on the display which is located on the left of the screen. If not set, the default value is an empty rectangle.
| Parameters | |
|---|---|
boundingRectLeft |
Rect: This value cannot be null. |
| Return | |
|---|---|
DisplayCutout.Builder |
This value cannot be null. |
setBoundingRectRight
fun setBoundingRectRight(boundingRectRight: Rect): DisplayCutout.Builder
Set a bounding rectangle for a non-functional area on the display which is located on the right of the screen. If not set, the default value is an empty rectangle.
| Parameters | |
|---|---|
boundingRectRight |
Rect: This value cannot be null. |
| Return | |
|---|---|
DisplayCutout.Builder |
This value cannot be null. |
setBoundingRectTop
fun setBoundingRectTop(boundingRectTop: Rect): DisplayCutout.Builder
Set a bounding rectangle for a non-functional area on the display which is located on the top of the screen. If not set, the default value is an empty rectangle.
| Parameters | |
|---|---|
boundingRectTop |
Rect: This value cannot be null. |
| Return | |
|---|---|
DisplayCutout.Builder |
This value cannot be null. |
setCutoutPath
fun setCutoutPath(cutoutPath: Path): DisplayCutout.Builder
Set the cutout Path. Note that not support creating/testing multiple display cutouts with setCutoutPath() in parallel.
| Parameters | |
|---|---|
cutoutPath |
Path: This value cannot be null. |
| Return | |
|---|---|
DisplayCutout.Builder |
This value cannot be null. |
setSafeInsets
fun setSafeInsets(safeInsets: Insets): DisplayCutout.Builder
Set the safe insets. If not set, the default value is Insets.NONE.
| Parameters | |
|---|---|
safeInsets |
Insets: This value cannot be null. |
| Return | |
|---|---|
DisplayCutout.Builder |
This value cannot be null. |
setWaterfallInsets
fun setWaterfallInsets(waterfallInsets: Insets): DisplayCutout.Builder
Set the waterfall insets of the DisplayCutout. If not set, the default value is Insets.NONE
| Parameters | |
|---|---|
waterfallInsets |
Insets: This value cannot be null. |
| Return | |
|---|---|
DisplayCutout.Builder |
This value cannot be null. |