issues
search
chaychan
/
MultipleItemRvAdapter
基于BaseRecyclerViewAdapterHelper封装多条目适配器,子条目单独在对应的ItemProvider中,便于项目维护(Based on the BaseRecyclerViewAdapterHelper package multi-item adapter, sub-item alone in the corresponding ItemProvider for easy project maintenance)
194
stars
35
forks
source link
在MultipleItemRvAdapter中使用ExpandableItem,打开/折叠事件混乱
#8
Open
wallnoo
opened
6 years ago
wallnoo
commented
6 years ago
/**
Adapter.class
传入Adapter */ override fun registerItemProvider() { mProviderDelegate.registerProvider(TitleProvider(this)) mProviderDelegate.registerProvider(NormalItemProvider()) } /**
Provider.class
TitleProvider接收Adapter引用并且对Item进行操作 */ override fun onClick(helper: BaseViewHolder, data: Title, position: Int) { super.onClick(helper, data, position) Log.i("aaa", "onClicked") if (data.isExpanded) { adapter.collapse(position) } else { adapter.expand(position) } }
那么问题来了,点击事件传过来了,Log打印了的,但是不能触发(打开/折叠)事件
/**
那么问题来了,点击事件传过来了,Log打印了的,但是不能触发(打开/折叠)事件