DividerItemDecoration

DividerItemDecoration is a RecyclerView.ItemDecoration that can be used as a divider between items of a LinearLayoutManager. It supports both HORIZONTAL and VERTICAL orientations.

    mDividerItemDecoration = new DividerItemDecoration(recyclerView.getContext(),
            mLayoutManager.getOrientation());
    recyclerView.addItemDecoration(mDividerItemDecoration);

Constructors

Link copied to clipboard
constructor(context: Context, orientation: Int)
Creates a divider RecyclerView.ItemDecoration that can be used with a LinearLayoutManager.

Properties

Link copied to clipboard
val HORIZONTAL: Int = 0
Link copied to clipboard
val VERTICAL: Int = 1

Functions

Link copied to clipboard
Link copied to clipboard
open fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State)
Retrieve any offsets for the given item.
Link copied to clipboard
open fun onDraw(c: Canvas, parent: RecyclerView, state: RecyclerView.State)
Draw any appropriate decorations into the Canvas supplied to the RecyclerView.
Link copied to clipboard
open fun setDrawable(@NonNull drawable: Drawable)
Sets the Drawable for this divider.
Link copied to clipboard
open fun setOrientation(orientation: Int)
Sets the orientation for this divider.