# DisplayCutout.Builder

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Ctors](https://developer.android.com/reference/android/view/DisplayCutout.Builder#pubctors)\|[Methods](https://developer.android.com/reference/android/view/DisplayCutout.Builder#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/view/DisplayCutout.Builder#inhmethods)  

# DisplayCutout.Builder

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/view/DisplayCutout.Builder "View this page in Kotlin")\|Java

`
public
static
final

class
DisplayCutout.Builder
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.view.DisplayCutout.Builder |

<br />

*** ** * ** ***

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](https://developer.android.com/reference/android/view/DisplayCutout)obtained from the system.

<br />

## Summary

|                                                          ### Public constructors                                                           ||
|-----------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[Builder](https://developer.android.com/reference/android/view/DisplayCutout.Builder#Builder())`() ` Begin building a DisplayCutout. |

|                                                                                                                                                                                                                             ### Public methods                                                                                                                                                                                                                             ||
|--------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[DisplayCutout](https://developer.android.com/reference/android/view/DisplayCutout)                 | ` `[build](https://developer.android.com/reference/android/view/DisplayCutout.Builder#build())`() ` Construct a new[DisplayCutout](https://developer.android.com/reference/android/view/DisplayCutout)with the set parameters.                                                                                                                                     |
| ` `[DisplayCutout.Builder](https://developer.android.com/reference/android/view/DisplayCutout.Builder) | ` `[setBoundingRectBottom](https://developer.android.com/reference/android/view/DisplayCutout.Builder#setBoundingRectBottom(android.graphics.Rect))`(`[Rect](https://developer.android.com/reference/android/graphics/Rect)` boundingRectBottom) ` Set a bounding rectangle for a non-functional area on the display which is located on the bottom of the screen. |
| ` `[DisplayCutout.Builder](https://developer.android.com/reference/android/view/DisplayCutout.Builder) | ` `[setBoundingRectLeft](https://developer.android.com/reference/android/view/DisplayCutout.Builder#setBoundingRectLeft(android.graphics.Rect))`(`[Rect](https://developer.android.com/reference/android/graphics/Rect)` boundingRectLeft) ` Set a bounding rectangle for a non-functional area on the display which is located on the left of the screen.         |
| ` `[DisplayCutout.Builder](https://developer.android.com/reference/android/view/DisplayCutout.Builder) | ` `[setBoundingRectRight](https://developer.android.com/reference/android/view/DisplayCutout.Builder#setBoundingRectRight(android.graphics.Rect))`(`[Rect](https://developer.android.com/reference/android/graphics/Rect)` boundingRectRight) ` Set a bounding rectangle for a non-functional area on the display which is located on the right of the screen.     |
| ` `[DisplayCutout.Builder](https://developer.android.com/reference/android/view/DisplayCutout.Builder) | ` `[setBoundingRectTop](https://developer.android.com/reference/android/view/DisplayCutout.Builder#setBoundingRectTop(android.graphics.Rect))`(`[Rect](https://developer.android.com/reference/android/graphics/Rect)` boundingRectTop) ` Set a bounding rectangle for a non-functional area on the display which is located on the top of the screen.             |
| ` `[DisplayCutout.Builder](https://developer.android.com/reference/android/view/DisplayCutout.Builder) | ` `[setCutoutPath](https://developer.android.com/reference/android/view/DisplayCutout.Builder#setCutoutPath(android.graphics.Path))`(`[Path](https://developer.android.com/reference/android/graphics/Path)` cutoutPath) ` Set the cutout[Path](https://developer.android.com/reference/android/graphics/Path).                                                    |
| ` `[DisplayCutout.Builder](https://developer.android.com/reference/android/view/DisplayCutout.Builder) | ` `[setSafeInsets](https://developer.android.com/reference/android/view/DisplayCutout.Builder#setSafeInsets(android.graphics.Insets))`(`[Insets](https://developer.android.com/reference/android/graphics/Insets)` safeInsets) ` Set the safe insets.                                                                                                              |
| ` `[DisplayCutout.Builder](https://developer.android.com/reference/android/view/DisplayCutout.Builder) | ` `[setWaterfallInsets](https://developer.android.com/reference/android/view/DisplayCutout.Builder#setWaterfallInsets(android.graphics.Insets))`(`[Insets](https://developer.android.com/reference/android/graphics/Insets)` waterfallInsets) ` Set the waterfall insets of the DisplayCutout.                                                                     |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Public constructors

### Builder

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public Builder ()
```

Begin building a DisplayCutout.

<br />

## Public methods

### build

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public DisplayCutout build ()
```

Construct a new[DisplayCutout](https://developer.android.com/reference/android/view/DisplayCutout)with the set parameters.

<br />

|                                                         Returns                                                         ||
|-------------------------------------------------------------------------------------|------------------------------------|
| [DisplayCutout](https://developer.android.com/reference/android/view/DisplayCutout) | This value cannot be`null`. <br /> |

### setBoundingRectBottom

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public DisplayCutout.Builder setBoundingRectBottom (Rect boundingRectBottom)
```

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.

<br />

|                            Parameters                            ||
|----------------------|--------------------------------------------|
| `boundingRectBottom` | `Rect`: This value cannot be`null`. <br /> |

|                                                                 Returns                                                                 ||
|-----------------------------------------------------------------------------------------------------|------------------------------------|
| [DisplayCutout.Builder](https://developer.android.com/reference/android/view/DisplayCutout.Builder) | This value cannot be`null`. <br /> |

### setBoundingRectLeft

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public DisplayCutout.Builder setBoundingRectLeft (Rect boundingRectLeft)
```

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.

<br />

|                           Parameters                           ||
|--------------------|--------------------------------------------|
| `boundingRectLeft` | `Rect`: This value cannot be`null`. <br /> |

|                                                                 Returns                                                                 ||
|-----------------------------------------------------------------------------------------------------|------------------------------------|
| [DisplayCutout.Builder](https://developer.android.com/reference/android/view/DisplayCutout.Builder) | This value cannot be`null`. <br /> |

### setBoundingRectRight

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public DisplayCutout.Builder setBoundingRectRight (Rect boundingRectRight)
```

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.

<br />

|                           Parameters                            ||
|---------------------|--------------------------------------------|
| `boundingRectRight` | `Rect`: This value cannot be`null`. <br /> |

|                                                                 Returns                                                                 ||
|-----------------------------------------------------------------------------------------------------|------------------------------------|
| [DisplayCutout.Builder](https://developer.android.com/reference/android/view/DisplayCutout.Builder) | This value cannot be`null`. <br /> |

### setBoundingRectTop

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public DisplayCutout.Builder setBoundingRectTop (Rect boundingRectTop)
```

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.

<br />

|                          Parameters                           ||
|-------------------|--------------------------------------------|
| `boundingRectTop` | `Rect`: This value cannot be`null`. <br /> |

|                                                                 Returns                                                                 ||
|-----------------------------------------------------------------------------------------------------|------------------------------------|
| [DisplayCutout.Builder](https://developer.android.com/reference/android/view/DisplayCutout.Builder) | This value cannot be`null`. <br /> |

### setCutoutPath

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public DisplayCutout.Builder setCutoutPath (Path cutoutPath)
```

Set the cutout[Path](https://developer.android.com/reference/android/graphics/Path). Note that not support creating/testing multiple display cutouts with setCutoutPath() in parallel.

<br />

|                        Parameters                        ||
|--------------|--------------------------------------------|
| `cutoutPath` | `Path`: This value cannot be`null`. <br /> |

|                                                                 Returns                                                                 ||
|-----------------------------------------------------------------------------------------------------|------------------------------------|
| [DisplayCutout.Builder](https://developer.android.com/reference/android/view/DisplayCutout.Builder) | This value cannot be`null`. <br /> |

### setSafeInsets

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public DisplayCutout.Builder setSafeInsets (Insets safeInsets)
```

Set the safe insets. If not set, the default value is[Insets.NONE](https://developer.android.com/reference/android/graphics/Insets#NONE).

<br />

|                         Parameters                         ||
|--------------|----------------------------------------------|
| `safeInsets` | `Insets`: This value cannot be`null`. <br /> |

|                                                                 Returns                                                                 ||
|-----------------------------------------------------------------------------------------------------|------------------------------------|
| [DisplayCutout.Builder](https://developer.android.com/reference/android/view/DisplayCutout.Builder) | This value cannot be`null`. <br /> |

### setWaterfallInsets

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public DisplayCutout.Builder setWaterfallInsets (Insets waterfallInsets)
```

Set the waterfall insets of the DisplayCutout. If not set, the default value is[Insets.NONE](https://developer.android.com/reference/android/graphics/Insets#NONE)

<br />

|                           Parameters                            ||
|-------------------|----------------------------------------------|
| `waterfallInsets` | `Insets`: This value cannot be`null`. <br /> |

|                                                                 Returns                                                                 ||
|-----------------------------------------------------------------------------------------------------|------------------------------------|
| [DisplayCutout.Builder](https://developer.android.com/reference/android/view/DisplayCutout.Builder) | This value cannot be`null`. <br /> |