DividerItemDecoration
open class DividerItemDecoration : RecyclerView.ItemDecoration
kotlin.Any | ||
↳ | androidx.recyclerview.widget.RecyclerView.ItemDecoration | |
↳ | androidx.recyclerview.widget.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);
Summary
Constants | |
---|---|
static Int | |
static Int |
Public constructors | |
---|---|
Creates a divider |
Public methods | |
---|---|
open Drawable? | |
open Unit |
getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State) |
open Unit |
onDraw(c: Canvas, parent: RecyclerView, state: RecyclerView.State) |
open Unit |
setDrawable(@NonNull drawable: Drawable) Sets the |
open Unit |
setOrientation(orientation: Int) Sets the orientation for this divider. |
Inherited functions | |
---|---|
Constants
Public constructors
<init>
DividerItemDecoration(
context: Context!,
orientation: Int)
Creates a divider RecyclerView.ItemDecoration
that can be used with a LinearLayoutManager
.
Parameters | |
---|---|
context |
Context!: Current context, it will be used to access resources. |
orientation |
Int: Divider orientation. Should be HORIZONTAL or VERTICAL . |