recycler-view-divider / com.fondesa.recyclerviewdivider / RecyclerViewDivider / Builder

Builder

class Builder

Builder class for RecyclerViewDivider.

Parameters

context - Context used to access the resources.

Constructors

<init>

Builder(context: Context)

Builder class for RecyclerViewDivider.

Functions

asSpace

fun asSpace(): RecyclerViewDivider.Builder

Set this divider as a space. This method is different from setting the transparent color as divider, because it will not draw anything, so, it's the most optimized one.

build

fun build(): RecyclerViewDivider

Creates a new RecyclerViewDivider with given configurations and initializes all values.

color

fun color(color: Int): RecyclerViewDivider.Builder

Set the color of all dividers. To set a custom color for each divider use drawableManager instead.

drawable

fun drawable(drawable: Drawable): RecyclerViewDivider.Builder

Set the drawable of all dividers. To set a custom drawable for each divider use drawableManager instead. Warning: if the span count is major than one and the drawable can't be mirrored, the drawable will not be shown correctly.

drawableManager

fun drawableManager(drawableManager: DrawableManager): RecyclerViewDivider.Builder

Set the divider's custom DrawableManager. Warning: if the span count is major than one and the drawable can't be mirrored, the drawable will not be shown correctly.

hideLastDivider

fun hideLastDivider(): RecyclerViewDivider.Builder

Hide the divider after the last group of items. Warning: when the spanCount is major than 1, only the divider after the last group will be hidden, the items' dividers, instead, will be shown. If you want to specify a more flexible behaviour, use visibilityManager instead.

inset

fun inset(insetBefore: Int, insetAfter: Int): RecyclerViewDivider.Builder

Set the inset before and after the divider. It will be equal for all dividers. To set a custom inset for each divider, use insetManager instead.

insetManager

fun insetManager(insetManager: InsetManager): RecyclerViewDivider.Builder

Set the divider's custom InsetManager.

size

fun size(size: Int): RecyclerViewDivider.Builder

Set the size of all dividers. The divider's final size will depend on RecyclerView's orientation: Size is referred to the height of an horizontal divider and to the width of a vertical divider. To set a custom size for each divider use sizeManager instead.

sizeManager

fun sizeManager(sizeManager: SizeManager): RecyclerViewDivider.Builder

Set the divider's custom SizeManager.

tint

fun tint(color: Int): RecyclerViewDivider.Builder

Set the tint color of all dividers' drawables. If you want to create a plain divider with a single color, color is recommended. To set a custom tint color for each divider's drawable use tintManager instead.

tintManager

fun tintManager(tintManager: TintManager): RecyclerViewDivider.Builder

Set the divider's custom TintManager.

visibilityManager

fun visibilityManager(visibilityManager: VisibilityManager): RecyclerViewDivider.Builder

Set the divider's custom VisibilityManager. If you want to hide only the last divider use hideLastDivider instead.