Skip to content

Commit 8285eb5

Browse files
author
lneedham
committed
SimpleRecyclerAdapter can take items as constructor param - fixed
1 parent 894b056 commit 8285eb5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

flowerpotrecycler/src/main/java/com/lukeneedham/flowerpotrecycler/simpleadapter/SimpleRecyclerAdapter.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ abstract class SimpleRecyclerAdapter<ItemType, ItemViewType>(items: List<ItemTyp
2222
}
2323

2424
var positionDelegate: AdapterPositionDelegate<ItemType> =
25-
LinearPositionDelegate(this, diffCallback)
25+
LinearPositionDelegate(this, diffCallback).apply {
26+
submitList(items)
27+
}
2628

2729
/**
2830
* Must be set before onCreateViewHolder is called. Otherwise, the value is ignored

0 commit comments

Comments
 (0)