DividerAttributes.DraggableDividerAttributes.Builder


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


The DraggableDividerAttributes builder.

Summary

Public constructors

creates a new DraggableDividerAttributes.Builder

The DraggableDividerAttributes builder constructor initialized by an existing DraggableDividerAttributes.

Public functions

DividerAttributes.DraggableDividerAttributes

Builds a DividerAttributes instance.

DividerAttributes.DraggableDividerAttributes.Builder

Sets the color of the divider.

DividerAttributes.DraggableDividerAttributes.Builder

Sets the drag range of the divider in terms of the split ratio of the primary container.

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

Sets the divider width.

Public constructors

Builder

Added in 1.4.0-alpha05
Builder()

creates a new DraggableDividerAttributes.Builder

Builder

Added in 1.4.0-alpha05
@RequiresWindowSdkExtension(version = 6)
Builder(original: DividerAttributes.DraggableDividerAttributes)

The DraggableDividerAttributes builder constructor initialized by an existing DraggableDividerAttributes.

Parameters
original: DividerAttributes.DraggableDividerAttributes

the original DraggableDividerAttributes to initialize the Builder

Public functions

setColor

Added in 1.4.0-alpha05
@RequiresWindowSdkExtension(version = 6)
fun setColor(color: @ColorInt Int): DividerAttributes.DraggableDividerAttributes.Builder

Sets the color of the divider. If not set, the default color Color.BLACK is used.

Throws
kotlin.IllegalArgumentException

if the provided value is invalid.

setDragRange

Added in 1.4.0-alpha05
@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 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: DividerAttributes.DragRange

the DragRange for the draggable divider.

setWidthDp

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

Sets the divider width. It defaults to WIDTH_SYSTEM_DEFAULT, which means the system will choose a default value based on the display size and form factor.

Throws
kotlin.IllegalArgumentException

if the provided value is invalid.