recycler-view-divider / com.fondesa.recyclerviewdivider / StaggeredDividerBuilder

StaggeredDividerBuilder

class StaggeredDividerBuilder

Builds a divider for a StaggeredGridLayoutManager or its subclasses. The following properties of a divider can be configured:

Parameters

context - the Context used to build the divider.

Constructors

<init>

StaggeredDividerBuilder(context: Context)

Builds a divider for a StaggeredGridLayoutManager or its subclasses. The following properties of a divider can be configured:

Functions

asSpace

fun asSpace(): StaggeredDividerBuilder

Sets the divider as a simple space, so the divider leaves the space between two cells but it is not rendered. Since the rendering is totally skipped in this case, it's better than using a transparent color.

build

fun build(): BaseDividerItemDecoration

Creates the RecyclerView.ItemDecoration using the configuration specified in this builder. If this builder doesn't specify the configuration of some divider's properties, those properties will be picked from the theme or their default will be used.

color

fun color(color: Int): StaggeredDividerBuilder

Sets the divider's color. If the color of this divider is not completely opaque (contains some transparency), this builder can't ensure a correct rendering.

colorRes

fun colorRes(colorRes: Int): StaggeredDividerBuilder

Sets the divider's color. If the color of this divider is not completely opaque (contains some transparency), this builder can't ensure a correct rendering.

hideSideDividers

fun hideSideDividers(): StaggeredDividerBuilder

Hides the side dividers of the grid. The side dividers are the ones before the first column and after the last column.

size

fun size(size: Int, sizeUnit: Int = TypedValue.COMPLEX_UNIT_PX): StaggeredDividerBuilder

Sets the divider's size. The size of an horizontal divider is its height. The size of a vertical divider is its width.