ItemDecoration

abstract class ItemDecoration(source)

An ItemDecoration allows the application to add a special drawing and layout offset to specific item views from the adapter's data set. This can be useful for drawing dividers between items, highlights, visual grouping boundaries and more.

All ItemDecorations are drawn in the order they were added, before the item views (in onDraw() and after the items (in onDrawOver.

Inheritors

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun getItemOffsets(@NonNull outRect: Rect, itemPosition: Int, @NonNull parent: RecyclerView)

open fun getItemOffsets(@NonNull outRect: Rect, @NonNull view: View, @NonNull parent: RecyclerView, @NonNull state: RecyclerView.State)
Retrieve any offsets for the given item.
Link copied to clipboard
open fun onDraw(@NonNull c: Canvas, @NonNull parent: RecyclerView)

open fun onDraw(@NonNull c: Canvas, @NonNull parent: RecyclerView, @NonNull state: RecyclerView.State)
Draw any appropriate decorations into the Canvas supplied to the RecyclerView.
Link copied to clipboard
open fun onDrawOver(@NonNull c: Canvas, @NonNull parent: RecyclerView)

Draw any appropriate decorations into the Canvas supplied to the RecyclerView.
Link copied to clipboard