bugfix: deliver wrong object to each method in QMUIPagerAdapter

This commit is contained in:
cgspine
2019-09-04 19:22:15 +08:00
parent 3e04d145e1
commit 82b88dbead
@@ -67,14 +67,14 @@ public abstract class QMUIPagerAdapter extends PagerAdapter {
/**
* sometimes you may need to perform some operations on all items,
* such as perform cleanup when the ViewPager is destroyed
* notice: this not
* once the action return true, then do not handle remain items
*
* @param action
*/
public void each(@NonNull Action action) {
int size = mScrapItems.size();
for (int i = 0; i < size; i++) {
Object item = mScrapItems.indexOfValue(i);
Object item = mScrapItems.valueAt(i);
if (action.call(item)) {
break;
}