mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-06-05 22:09:15 +02:00
use the more advanced file renaming if only files are selected
This commit is contained in:
@ -178,18 +178,26 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList<ListItem
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun displayRenameDialog() {
|
private fun displayRenameDialog() {
|
||||||
val paths = getSelectedFileDirItems().asSequence().map { it.path }.toMutableList() as ArrayList<String>
|
val fileDirItems = getSelectedFileDirItems()
|
||||||
if (paths.size == 1) {
|
val paths = fileDirItems.asSequence().map { it.path }.toMutableList() as ArrayList<String>
|
||||||
val oldPath = paths.first()
|
when {
|
||||||
RenameItemDialog(activity, oldPath) {
|
paths.size == 1 -> {
|
||||||
activity.config.moveFavorite(oldPath, it)
|
val oldPath = paths.first()
|
||||||
|
RenameItemDialog(activity, oldPath) {
|
||||||
|
activity.config.moveFavorite(oldPath, it)
|
||||||
|
activity.runOnUiThread {
|
||||||
|
listener?.refreshItems()
|
||||||
|
finishActMode()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fileDirItems.any { it.isDirectory } -> RenameItemsDialog(activity, paths) {
|
||||||
activity.runOnUiThread {
|
activity.runOnUiThread {
|
||||||
listener?.refreshItems()
|
listener?.refreshItems()
|
||||||
finishActMode()
|
finishActMode()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
else -> RenameItemsPatternDialog(activity, paths) {
|
||||||
RenameItemsDialog(activity, paths) {
|
|
||||||
activity.runOnUiThread {
|
activity.runOnUiThread {
|
||||||
listener?.refreshItems()
|
listener?.refreshItems()
|
||||||
finishActMode()
|
finishActMode()
|
||||||
|
Reference in New Issue
Block a user