daimajia / AndroidSwipeLayout

The Most Powerful Swipe Layout!
MIT License
12.38k stars 2.67k forks source link

recycleView 数据源reSet mShownLayouts慢慢增大 #451

Open Voidruiyi opened 7 years ago

Voidruiyi commented 7 years ago

bindView(View target, int position) 时, 判断依赖recycle缓存机制 复用存在问题

if (swipeLayout.getTag(resId) == null) { SwipeMemory swipeMemory = new SwipeMemory(position); swipeLayout.addSwipeListener(swipeMemory); swipeLayout.addOnLayoutListener(onLayoutListener); swipeLayout.setTag(resId, new ValueBox(position, swipeMemory, onLayoutListener)); mShownLayouts.add(swipeLayout); } else { ValueBox valueBox = (ValueBox) swipeLayout.getTag(resId); valueBox.swipeMemory.setPosition(position); valueBox.onLayoutListener.setPosition(position); valueBox.position = position; }