DividerAttributes.DraggableDividerAttributes.Builder


@RequiresWindowSdkExtension(version = 6)
public final 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 methods

final @NonNull DividerAttributes.DraggableDividerAttributes

Builds a DividerAttributes instance.

final @NonNull DividerAttributes.DraggableDividerAttributes.Builder
@RequiresWindowSdkExtension(version = 6)
setColor(@ColorInt int color)

Sets the color of the divider.

final @NonNull DividerAttributes.DraggableDividerAttributes.Builder

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

final @NonNull DividerAttributes.DraggableDividerAttributes.Builder
@RequiresWindowSdkExtension(version = 6)
setWidthDp(@IntRange(from = -1) int widthDp)

Sets the divider width.

Public constructors

Builder

Added in 1.4.0-alpha05
public Builder()

creates a new DraggableDividerAttributes.Builder

Builder

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

The DraggableDividerAttributes builder constructor initialized by an existing DraggableDividerAttributes.

Parameters
@NonNull DividerAttributes.DraggableDividerAttributes original

the original DraggableDividerAttributes to initialize the Builder

Public methods

build

Added in 1.4.0-alpha05
@RequiresWindowSdkExtension(version = 6)
public final @NonNull DividerAttributes.DraggableDividerAttributes build()

Builds a DividerAttributes instance.

setColor

Added in 1.4.0-alpha05
@RequiresWindowSdkExtension(version = 6)
public final @NonNull DividerAttributes.DraggableDividerAttributes.Builder setColor(@ColorInt int color)

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)
public final @NonNull DividerAttributes.DraggableDividerAttributes.Builder setDragRange(@NonNull DividerAttributes.DragRange dragRange)

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
@NonNull DividerAttributes.DragRange dragRange

the DragRange for the draggable divider.

setWidthDp

Added in 1.4.0-alpha05
@RequiresWindowSdkExtension(version = 6)
public final @NonNull DividerAttributes.DraggableDividerAttributes.Builder setWidthDp(@IntRange(from = -1) int widthDp)

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.