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