java.lang.Object | |
↳ | android.support.v7.widget.RecyclerView.ItemDecoration |
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(Canvas, RecyclerView)
.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Retrieve any offsets for the given item.
| |||||||||||
Draw any appropriate decorations into the Canvas supplied to the RecyclerView.
| |||||||||||
Draw any appropriate decorations into the Canvas supplied to the RecyclerView.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Retrieve any 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.
The default implementation sets the bounds of outRect to 0 and returns.
If this ItemDecoration does not affect the positioning of item views it should set
all four fields of outRect
(left, top, right, bottom) to zero
before returning.
outRect | Rect to receive the output. |
---|---|
itemPosition | Adapter position of the item to offset |
parent | RecyclerView this ItemDecoration is decorating |
Draw any appropriate decorations into the Canvas supplied to the RecyclerView. Any content drawn by this method will be drawn before the item views are drawn, and will thus appear underneath the views.
c | Canvas to draw into |
---|---|
parent | RecyclerView this ItemDecoration is drawing into |
Draw any appropriate decorations into the Canvas supplied to the RecyclerView. Any content drawn by this method will be drawn after the item views are drawn and will thus appear over the views.
c | Canvas to draw into |
---|---|
parent | RecyclerView this ItemDecoration is drawing into |