Skip to content

Commit

Permalink
fix bug: 'SelectableHelper#clearSelected()'
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfeng committed Nov 27, 2020
1 parent 434d84a commit 64b5a25
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,9 @@ public void setSelectMode(SelectMode mode) {
/**
* 清除所所列表项的选中状态。
*/
@SuppressWarnings("WhileLoopReplaceableByForEach")
public void clearSelected() {
Iterator<Integer> iterator = mSelectedPositions.iterator();
while (iterator.hasNext()) {
// 不能使用 for 循环,因为该方法会会删除列表中的元素
deselect(iterator.next());
for (int position : new ArrayList<>(mSelectedPositions)) {
deselect(position);
}
notifySelectCountChanged();
}
Expand Down

0 comments on commit 64b5a25

Please sign in to comment.