HorizontalListDividerDecoration

class HorizontalListDividerDecoration(drawable: Drawable) : RecyclerView.ItemDecoration

A RecyclerView.ItemDecoration used to add a divider between list items in the RecyclerView. The RecyclerView.Adapter has to be a ListGroupItemsCollection.

Parameters

drawable

The drawable used to draw a divider. The drawable width is ignored.

Constructors

Link copied to clipboard
fun HorizontalListDividerDecoration(drawable: Drawable)

Functions

Link copied to clipboard
open override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State)

Retrieves offsets for the given item. Each field of outRect specifies the number of pixels that the item view should be inset by, similar to padding or margin.

Link copied to clipboard
open override fun onDraw(canvas: Canvas, parent: RecyclerView, state: RecyclerView.State)

Draw the drawable into the canvas supplied to the RecyclerView.

Inherited functions

Link copied to clipboard
open fun getItemOffsets(@NonNull p0: Rect, p1: Int, @NonNull p2: RecyclerView)
Link copied to clipboard
open fun onDraw(@NonNull p0: Canvas, @NonNull p1: RecyclerView)
Link copied to clipboard
open fun onDrawOver(@NonNull p0: Canvas, @NonNull p1: RecyclerView)
open fun onDrawOver(@NonNull p0: Canvas, @NonNull p1: RecyclerView, @NonNull p2: RecyclerView.State)