update selectable item count at deleting an item

This commit is contained in:
tibbi 2017-11-19 18:24:43 +01:00
parent 0a023dd0fa
commit 7f31975053
1 changed files with 4 additions and 7 deletions

View File

@ -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
} }
} }