yuqirong / CardSwipeLayout

Use RecyclerView to achieve card swipe layout , like Tantan . (模仿探探卡片滑动效果的布局)
MIT License
1.25k stars 187 forks source link

关于剩余图片的计算,预加载 #11

Open zizikoth opened 6 years ago

zizikoth commented 6 years ago

@Override public void onSwiped(RecyclerView.ViewHolder viewHolder, Image.DataBean img, int direction) { Logger.i("index = " + viewHolder.getLayoutPosition()); // index = 0 Logger.i("index = " + mData.indexOf(img)); // index = -1 mData是数据源 Logger.i("index = " + adapter.getItemCount()); // index = 10 正常 if (adapter.getItemCount() == 5) { pageindex++; getData(); snackbar.show((MainActivity) mContext); } } 如果是清空之后在加载图片的话体验不是很好 没有直接的点击事件 请原谅我直接下载了代码 进行修改