optimize the way of fetching all selected items
This commit is contained in:
parent
9aaf8fb53b
commit
599ea09b6b
|
@ -513,15 +513,7 @@ class ItemsAdapter(activity: SimpleActivity, var fileDirItems: MutableList<FileD
|
|||
|
||||
private fun getFirstSelectedItemPath() = getSelectedFileDirItems().first().path
|
||||
|
||||
private fun getSelectedFileDirItems(): ArrayList<FileDirItem> {
|
||||
val selectedFileDirItems = ArrayList<FileDirItem>(selectedKeys.size)
|
||||
selectedKeys.forEach {
|
||||
getItemWithKey(it)?.apply {
|
||||
selectedFileDirItems.add(this)
|
||||
}
|
||||
}
|
||||
return selectedFileDirItems
|
||||
}
|
||||
private fun getSelectedFileDirItems() = fileDirItems.filter { selectedKeys.contains(it.path.hashCode()) } as ArrayList<FileDirItem>
|
||||
|
||||
fun updateItems(newItems: ArrayList<FileDirItem>, highlightText: String = "") {
|
||||
if (newItems.hashCode() != currentItemsHash) {
|
||||
|
|
Loading…
Reference in New Issue