recycler-view-divider / com.fondesa.recyclerviewdivider / BaseDividerItemDecoration / onDraw

onDraw

protected abstract fun onDraw(canvas: Canvas, recyclerView: RecyclerView, layoutManager: LayoutManager, itemCount: Int): Unit

Variation of RecyclerView.ItemDecoration.onDraw which validates the RecyclerView before being notified. This method will be invoked only if the divider shouldn't behave as a space since, if it's a space, it shouldn't draw anything.

Parameters

canvas - the Canvas on which the divider should be drawn.

recyclerView - the RecyclerView which has added this decoration.

layoutManager - the RecyclerView.LayoutManager attached to the RecyclerView.

itemCount - the number of items in the adapter attached to the RecyclerView.

See Also

RecyclerView.ItemDecoration.onDraw

fun onDraw(c: Canvas, parent: RecyclerView, state: State): Unit
fun onDraw(c: Canvas, parent: RecyclerView): Unit