I want to add a section header or something to state its a new section but I just can't get it right. The testSection.setHeader()
method I commented out requires an item called Header : Group
.
This is the code for the recycler view:
private fun updateRecyclerViewTest(items: List<Item>) {
fun init() {
recycler_view_test.apply {
layoutManager = LinearLayoutManager(this@EditModActivity)
adapter = GroupAdapter<ViewHolder>().apply {
testSection = Section(items)
assSection = Section(items)
//pracSection = Section(items)
add(testSection)
add(assSection)
//add(pracSection)
setOnItemClickListener(onItemClick)
}
}
shouldInitRecyclerView = false
}
if (shouldInitRecyclerView)
init()
else
{
testSection.update(items.subList(0,3))
//testSection.setHeader()
assSection.update(items.subList(4,6))
//pracSection.update(items.subList(6,9))
}
}
This is the current output