Invalidate options menu when changing explorer elements

This commit is contained in:
Matéo Duparc 2021-12-18 11:48:05 +01:00
parent 83525159e3
commit d1a556b8c6
Signed by: hardcoresushi
GPG Key ID: 007F84120107191E
3 changed files with 1 additions and 7 deletions

View File

@ -27,10 +27,6 @@ class ExplorerElementAdapter(
) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
val dateFormat: DateFormat = DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT, Locale.getDefault())
var explorerElements = listOf<ExplorerElement>()
set(value) {
field = value
unSelectAll()
}
val selectedItems: MutableList<Int> = ArrayList()
override fun getItemCount(): Int {

View File

@ -223,6 +223,7 @@ open class BaseExplorerActivity : BaseActivity() {
ExplorerElement.sortBy(sortOrderValues[currentSortOrderIndex], foldersFirst, explorerElements)
}
explorerAdapter.explorerElements = explorerElements
unselectAll()
val sharedPrefsEditor = sharedPrefs.edit()
sharedPrefsEditor.putString(ConstValues.sort_order_key, sortOrderValues[currentSortOrderIndex])
sharedPrefsEditor.apply()

View File

@ -343,7 +343,6 @@ class ExplorerActivity : BaseExplorerActivity() {
}
}
cancelItemAction()
unselectAll()
}
} else if (currentItemAction == ItemsActions.MOVE){
mapFileForMove(itemsToProcess, itemsToProcess[0].explorerElement.parentPath)
@ -365,7 +364,6 @@ class ExplorerActivity : BaseExplorerActivity() {
}
}
cancelItemAction()
unselectAll()
}
}
true
@ -459,7 +457,6 @@ class ExplorerActivity : BaseExplorerActivity() {
break
}
}
unselectAll()
setCurrentPath(currentDirectoryPath) //refresh
}
}