use the more advanced file renaming if only files are selected

This commit is contained in:
tibbi 2019-06-14 14:50:54 +02:00
parent eabe129edf
commit bcb927febb

View file

@ -178,8 +178,10 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList<ListItem
}
private fun displayRenameDialog() {
val paths = getSelectedFileDirItems().asSequence().map { it.path }.toMutableList() as ArrayList<String>
if (paths.size == 1) {
val fileDirItems = getSelectedFileDirItems()
val paths = fileDirItems.asSequence().map { it.path }.toMutableList() as ArrayList<String>
when {
paths.size == 1 -> {
val oldPath = paths.first()
RenameItemDialog(activity, oldPath) {
activity.config.moveFavorite(oldPath, it)
@ -188,8 +190,14 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList<ListItem
finishActMode()
}
}
} else {
RenameItemsDialog(activity, paths) {
}
fileDirItems.any { it.isDirectory } -> RenameItemsDialog(activity, paths) {
activity.runOnUiThread {
listener?.refreshItems()
finishActMode()
}
}
else -> RenameItemsPatternDialog(activity, paths) {
activity.runOnUiThread {
listener?.refreshItems()
finishActMode()