mirror of
https://github.com/FossifyOrg/File-Manager.git
synced 2026-10-23 23:28:36 -04:00
optimize the way of fetching all selected items
This commit is contained in:
1 parent
9aaf8fb53b
commit
599ea09b6b
1 file changed
+1
-9
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user