I am populating my data to the RecylerView using Groupie Adapter with different types of items and using expandable groups and sections, one of the items is a Horizontal RecyclerView - everything works fine except that ** I am not able to scroll the child Horizontal RecyclerView to see its items.**
var uiList = mutableListOf<Group>()
private val adapter = GroupAdapter<GroupieViewHolder>()
......
val horizontalListItem = PiHorizontalListItem(
mediaIdCounter++,
horizontalAdapter,
nestedSharedViewPool
)
expandableGroup.add(
horizontalListItem
)
.....
uiList.plusAssign(expandableGroup)
adapter.addAll(uiList)
mainRecyclerView.adapter = adapter
where the PiHorizontalListItem contains a RecyclerView
class PiHorizontalListItem(
private val id: Long,
private val carouselAdapter: GroupAdapter<GroupieViewHolder>,
private val sharedPool: RecyclerView.RecycledViewPool
) :Item() {
override fun getId(): Long = id
override fun getLayout(): Int = R.layout.item_horizontal_rv
override fun bind(viewHolder: GroupieViewHolder, position: Int) {
viewHolder.containerView.rv.apply {
setRecycledViewPool(sharedPool)
(layoutManager as LinearLayoutManager).orientation = LinearLayoutManager.HORIZONTAL
(layoutManager as LinearLayoutManager).recycleChildrenOnDetach = true
adapter = carouselAdapter
setHasFixedSize(true)
}
}
}
Can anybody help me fix this issue or if there is a workaround for it?