Using RecyclerView with ItemDecorations - A Basic Separator Sample
tl;dr You can find the sample on GitHub.
I’ve seen many people come up with complicated and bloated solutions to problems that can actually be solved with decorations quite easily. Generally speaking, by using decorations you can, without modifying any code in your adapter
- add a Header / Footer View
- add margins and separators
- set backgrounds
- and more.
Easily added and reused with one line of code.