# DividerAttributes.DraggableDividerAttributes.Builder

Artifact: [androidx.window:window](https://developer.android.com/jetpack/androidx/releases/window) [View Source](https://cs.android.com/search?q=file:androidx/window/embedding/DividerAttributes.kt+class:androidx.window.embedding.DividerAttributes.DraggableDividerAttributes.Builder) Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/window#1.4.0)

*** ** * ** ***

<br />

```
@RequiresWindowSdkExtension(version = 6)
class DividerAttributes.DraggableDividerAttributes.Builder
```

<br />

*** ** * ** ***

The `https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DraggableDividerAttributes` builder.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DraggableDividerAttributes.Builder#Builder()()` creates a new `https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DraggableDividerAttributes.Builder` |
| `@https://developer.android.com/reference/kotlin/androidx/window/RequiresWindowSdkExtension(version = 6) https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DraggableDividerAttributes.Builder#Builder(androidx.window.embedding.DividerAttributes.DraggableDividerAttributes)(original: https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DraggableDividerAttributes)` The `https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DraggableDividerAttributes` builder constructor initialized by an existing `https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DraggableDividerAttributes`. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DraggableDividerAttributes` | `@https://developer.android.com/reference/kotlin/androidx/window/RequiresWindowSdkExtension(version = 6) https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DraggableDividerAttributes.Builder#build()()` Builds a `https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes` instance. |
| `https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DraggableDividerAttributes.Builder` | `@https://developer.android.com/reference/kotlin/androidx/window/RequiresWindowSdkExtension(version = 6) https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DraggableDividerAttributes.Builder#setColor(kotlin.Int)(color: @https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the color of the divider. |
| `https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DraggableDividerAttributes.Builder` | `@https://developer.android.com/reference/kotlin/androidx/window/RequiresWindowSdkExtension(version = 6) https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DraggableDividerAttributes.Builder#setDragRange(androidx.window.embedding.DividerAttributes.DragRange)(dragRange: https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DragRange)` Sets the drag range of the divider in terms of the split ratio of the primary container. |
| `https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DraggableDividerAttributes.Builder` | `@https://developer.android.com/reference/kotlin/androidx/window/RequiresWindowSdkExtension(version = 7) https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DraggableDividerAttributes.Builder#setDraggingToFullscreenAllowed(kotlin.Boolean)(allowed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Sets whether dragging to full screen is allowed. |
| `https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DraggableDividerAttributes.Builder` | `@https://developer.android.com/reference/kotlin/androidx/window/RequiresWindowSdkExtension(version = 6) https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DraggableDividerAttributes.Builder#setWidthDp(kotlin.Int)(widthDp: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = -1) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the divider width. |

## Public constructors

### Builder

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

```
Builder()
```

creates a new `https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DraggableDividerAttributes.Builder`

### Builder

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

```
@RequiresWindowSdkExtension(version = 6)
Builder(original: DividerAttributes.DraggableDividerAttributes)
```

The `https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DraggableDividerAttributes` builder constructor initialized by an existing `https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DraggableDividerAttributes`.

| Parameters |
|---|---|
| `original: https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DraggableDividerAttributes` | the original `https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DraggableDividerAttributes` to initialize the `https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DraggableDividerAttributes.Builder` |

## Public functions

### build

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

```
@RequiresWindowSdkExtension(version = 6)
fun build(): DividerAttributes.DraggableDividerAttributes
```

Builds a `https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes` instance.

### setColor

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

```
@RequiresWindowSdkExtension(version = 6)
fun setColor(color: @ColorInt Int): DividerAttributes.DraggableDividerAttributes.Builder
```

Sets the color of the divider. If not set, the default color `https://developer.android.com/reference/android/graphics/Color.html#BLACK` is used.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if the provided value is invalid. |

### setDragRange

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

```
@RequiresWindowSdkExtension(version = 6)
fun setDragRange(dragRange: DividerAttributes.DragRange): DividerAttributes.DraggableDividerAttributes.Builder
```

Sets the drag range of the divider in terms of the split ratio of the primary container. It defaults to `https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DragRange#DRAG_RANGE_SYSTEM_DEFAULT()`, which means the system will choose a default value based on the display size and form factor.

When the user drags the divider beyond this range, the system will choose to either fully expand the container or move the divider back into the range.

| Parameters |
|---|---|
| `dragRange: https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DragRange` | the `https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DragRange` for the draggable divider. |

### setDraggingToFullscreenAllowed

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

```
@RequiresWindowSdkExtension(version = 7)
fun setDraggingToFullscreenAllowed(allowed: Boolean): DividerAttributes.DraggableDividerAttributes.Builder
```

Sets whether dragging to full screen is allowed.

If `true`, the user is allowed to drag beyond the specified range temporarily. When dragging is finished, if the dragging position is below the `https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DragRange.SplitRatioDragRange#minRatio()` or the default min ratio in `https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DragRange#DRAG_RANGE_SYSTEM_DEFAULT()`, the system will choose to either fully expand the secondary container or move the divider back to the range limit; if the dragging position is above the `https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DragRange.SplitRatioDragRange#maxRatio()` or the default max ratio in `https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes.DragRange#DRAG_RANGE_SYSTEM_DEFAULT()`, the system will choose to either fully expand the primary container or move the divider back to the range limit.

When the primary container is fully expanded, the secondary container is dismissed. When the secondary container is fully expanded, the primary container is hidden behind the secondary container, and the drag handle is displayed on the edge to allow the user to drag and bring back the primary container.

Default to `false`.

This is only supported on devices with Window SDK extensions version 7 and above. For devices with Window SDK extensions below version 7, dragging to fullscreen is always disabled.

### setWidthDp

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

```
@RequiresWindowSdkExtension(version = 6)
fun setWidthDp(widthDp: @IntRange(from = -1) Int): DividerAttributes.DraggableDividerAttributes.Builder
```

Sets the divider width. It defaults to `https://developer.android.com/reference/kotlin/androidx/window/embedding/DividerAttributes#WIDTH_SYSTEM_DEFAULT()`, which means the system will choose a default value based on the display size and form factor.

When 0dp is used for a draggable divider, the drag handle is rendered without a divider line.

Note: a known compatibility issue causes incorrect rendering of 0-width divider in extensions v7. In this case, the divider width is set to 1dp as a mitigation.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if the provided value is invalid. |