# SurfaceControlCompat.Builder

Artifact: [androidx.graphics:graphics-core](https://developer.android.com/jetpack/androidx/releases/graphics) [View Source](https://cs.android.com/search?q=file:androidx/graphics/surface/SurfaceControlCompat.kt+class:androidx.graphics.surface.SurfaceControlCompat.Builder) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.0.0)

*** ** * ** ***


```
public final class SurfaceControlCompat.Builder
```

<br />

*** ** * ** ***

Builder class for `https://developer.android.com/reference/androidx/graphics/surface/SurfaceControlCompat` objects. By default the `https://developer.android.com/reference/android/view/Surface.html` will be hidden, and have "unset" bounds, meaning it can be as large as the bounds of its parent if a buffer or child so requires. It is necessary to set at least a name via `https://developer.android.com/reference/androidx/graphics/surface/SurfaceControlCompat.Builder#setName(kotlin.String)`

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/graphics/surface/SurfaceControlCompat.Builder#Builder()()` |

| ### Public methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/graphics/surface/SurfaceControlCompat` | `https://developer.android.com/reference/androidx/graphics/surface/SurfaceControlCompat.Builder#build()()` Construct a new `https://developer.android.com/reference/androidx/graphics/surface/SurfaceControlCompat` with the set parameters. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/graphics/surface/SurfaceControlCompat.Builder` | `https://developer.android.com/reference/androidx/graphics/surface/SurfaceControlCompat.Builder#setName(kotlin.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html name)` Set a debugging-name for the `https://developer.android.com/reference/androidx/graphics/surface/SurfaceControlCompat`. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/graphics/surface/SurfaceControlCompat.Builder` | `https://developer.android.com/reference/androidx/graphics/surface/SurfaceControlCompat.Builder#setParent(androidx.graphics.surface.SurfaceControlCompat)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/graphics/surface/SurfaceControlCompat surfaceControl)` Set a parent `https://developer.android.com/reference/androidx/graphics/surface/SurfaceControlCompat` for the new `https://developer.android.com/reference/androidx/graphics/surface/SurfaceControlCompat` instance. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/graphics/surface/SurfaceControlCompat.Builder` | `https://developer.android.com/reference/androidx/graphics/surface/SurfaceControlCompat.Builder#setParent(android.view.SurfaceView)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/SurfaceView.html surfaceView)` Set a parent `https://developer.android.com/reference/android/view/Surface.html` from the provided `https://developer.android.com/reference/android/view/SurfaceView.html` for our new `https://developer.android.com/reference/androidx/graphics/surface/SurfaceControlCompat`. |

## Public constructors

### Builder

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.0.0)

```
public Builder()
```

## Public methods

### build

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.0.0)

```
public final @NonNull SurfaceControlCompat build()
```

Construct a new `https://developer.android.com/reference/androidx/graphics/surface/SurfaceControlCompat` with the set parameters. The builder remains valid after the `https://developer.android.com/reference/androidx/graphics/surface/SurfaceControlCompat` instance is created.

### setName

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.0.0)

```
public final @NonNull SurfaceControlCompat.Builder setName(@NonNull String name)
```

Set a debugging-name for the `https://developer.android.com/reference/androidx/graphics/surface/SurfaceControlCompat`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html name` | Debugging name configured on the `https://developer.android.com/reference/androidx/graphics/surface/SurfaceControlCompat` instance. |

### setParent

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.0.0)

```
public final @NonNull SurfaceControlCompat.Builder setParent(@NonNull SurfaceControlCompat surfaceControl)
```

Set a parent `https://developer.android.com/reference/androidx/graphics/surface/SurfaceControlCompat` for the new `https://developer.android.com/reference/androidx/graphics/surface/SurfaceControlCompat` instance. Furthermore they stack relatively in Z order, and inherit the transformation of the parent.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/graphics/surface/SurfaceControlCompat surfaceControl` | Target `https://developer.android.com/reference/androidx/graphics/surface/SurfaceControlCompat` used as the parent for the newly created `https://developer.android.com/reference/androidx/graphics/surface/SurfaceControlCompat` instance |

### setParent

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.0.0)

```
public final @NonNull SurfaceControlCompat.Builder setParent(@NonNull SurfaceView surfaceView)
```

Set a parent `https://developer.android.com/reference/android/view/Surface.html` from the provided `https://developer.android.com/reference/android/view/SurfaceView.html` for our new `https://developer.android.com/reference/androidx/graphics/surface/SurfaceControlCompat`. Child surfaces are constrained to the onscreen region of their parent. Furthermore they stack relatively in Z order, and inherit the transformation of the parent.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/SurfaceView.html surfaceView` | Target `https://developer.android.com/reference/android/view/SurfaceView.html` used to provide the `https://developer.android.com/reference/android/view/Surface.html` this `https://developer.android.com/reference/androidx/graphics/surface/SurfaceControlCompat` is associated with. |