yqritc/RecyclerView-FlexibleDivider

.marginResId(R.dimen.leftmargin, R.dimen.rightmargin) has error

chenxi0203 opened this issue · 3 comments

HorizontalDividerItemDecoration decoration = new HorizontalDividerItemDecoration.Builder(this)
.drawable(R.drawable.ic_list_divider)
.showLastDivider()
.marginResId(R.dimen.dp_15, 0)
.build();
mRecyclerView.addItemDecoration(decoration);

.marginResId(R.dimen.dp_15, 0)

0 -->R.dimen.dp_0

Check your dimens.xml. You all dimen shoud have dp
For example:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <dimen name="leftmargin">8dp</dimen>
    <dimen name="rightmargin">0dp</dimen>
</resources>