This is the code for setting the decoration :-
recyclerView.addItemDecoration(new DividerItemDecoration(recyclerView.getContext(), DividerItemDecoration.HORIZONTAL));
This is the xml :-
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<size android:height="1dp" />
<solid android:color="@android:color/black" />
</shape>
I have tried setting the drawable using DividerItemDecoration.setDrawable(Drawable drawable)
and setting the android:listDivider
item in my theme to point to the xml.
I have also tried setting the width to 1dp. Absolutely nothing works.
Any help is appreciated, thanks.