update selectable item count at deleting an item
This commit is contained in:
parent
0a023dd0fa
commit
7f31975053
1 changed files with 4 additions and 7 deletions
|
@ -366,15 +366,12 @@ class ItemsAdapter(activity: SimpleActivity, var fileDirItems: MutableList<FileD
|
|||
listener?.deleteFiles(files)
|
||||
|
||||
val newItems = SparseArray<View>()
|
||||
var curIndex = 0
|
||||
for (i in 0 until itemViews.size()) {
|
||||
if (itemViews[i] != null) {
|
||||
newItems.put(curIndex, itemViews[i])
|
||||
curIndex++
|
||||
}
|
||||
}
|
||||
(0 until itemViews.size())
|
||||
.filter { itemViews[it] != null }
|
||||
.forEachIndexed { curIndex, i -> newItems.put(curIndex, itemViews[i]) }
|
||||
|
||||
itemViews = newItems
|
||||
selectableItemCount = fileDirItems.size
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue