Android - Kotlin - object must be declared abstract or implement abstract member

前端 未结 2 1062
[愿得一人]
[愿得一人] 2021-01-13 00:03

I have set an ItemClickLister for my RecyclerView like this:

ItemClickSupport.addTo(recyclerView!!).setOnItemClickListener(
                    object : Item         


        
2条回答
  •  一生所求
    2021-01-13 00:56

    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()
                }
            }
    
        })
    

提交回复
热议问题