Parameters

the index in the list of decorations for this RecyclerView. This is the order in which getItemOffset and onDraw are called. Later calls might overdraw previous ones.

Remarks

Decorations are static

Since decorations are only drawn, it is not possible to add click listeners or other UI functionality to them.

Multiple decorations

Adding multiple decorations to a RecyclerView will work in some cases, but there is currently no public API to take other possible decorations into account when measuring or drawing. You can get the view bounds or the view decorated bounds, where the decorated bounds are the sum of all the decoration offsets applied.

This image is just an example how dividers working , if you want to follow Material Design specs when adding dividers please take a look at this link : dividers and thanks @Brenden Kromhout by providing link .

Drawing a Separator

This will draw a line at the bottom of every view but the last to act as a separator between items.