alibaba / vlayout

Project vlayout is a powerfull LayoutManager extension for RecyclerView, it provides a group of layouts for RecyclerView. Make it able to handle a complicate situation when grid, list and other layouts in the same recyclerview.
http://tangram.pingguohe.net/
MIT License
10.8k stars 1.79k forks source link

子adpater 采用AsyncListDiffer删除数据,之后再点击item出现position错位 #502

Open sun804336516 opened 4 years ago

sun804336516 commented 4 years ago

0号位删除,正常1号位补到0,但是1号位的position还是0 目前只能通过 //重新刷新数据 mRcv.post(new Runnable() { @Override public void run() { mAdapter.notifyItemRangeChanged(0, mAdapter.getItemCount()); } }); 解决问题

sun804336516 commented 4 years ago

子adapter中onBindViewHolder添加了view的点击事件 holder.itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (mItemClickListener != null) { mItemClickListener.onItemClick(holder, v, position); } } });