This is an example of how it could have been done previously in the ListView class, using the divider and dividerHeight parame
Add a margin to your view, it worked for me.
android:layout_marginTop="10dp"
If you just want to add equal spacing and want to do it in XML, just set padding to your RecyclerView and equal amount of layoutMargin to the item you inflate into your RecyclerView, and let the background color determine the spacing color.