Instead of using XML to add margin between items in RecyclerView, it's better way to use RecyclerView.ItemDecoration that provide by android framework.
So, I create a library to solve this issue.
https://github.com/TheKhaeng/recycler-view-margin-decoration