I have set an ItemClickLister for my RecyclerView like this:
ItemClickSupport.addTo(recyclerView!!).setOnItemClickListener(
object : Item
Try with it:
ItemClickSupport.addTo(listView).setOnItemClickListener(object : ItemClickSupport.OnItemClickListener{
override fun onItemClicked(recyclerView: RecyclerView, position: Int, v: View) {
val row = recyclerView!!.getChildAt(position)
val el = row.findViewById(R.id.active_expandablelayout) as ExpandableLayout
if (el.isExpanded) {
el.collapse()
} else {
el.expand()
}
}
})