diff --git a/app/build.gradle b/app/build.gradle index 4d2a0e92..4d40ebf7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,7 +32,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.16.9' + compile 'com.simplemobiletools:commons:2.17.2' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" } diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt index 968d3321..dc912170 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt @@ -12,6 +12,7 @@ import com.bignerdranch.android.multiselector.SwappingHolder import com.bumptech.glide.Glide import com.simplemobiletools.commons.asynctasks.CopyMoveTask import com.simplemobiletools.commons.dialogs.ConfirmationDialog +import com.simplemobiletools.commons.dialogs.FilePickerDialog import com.simplemobiletools.commons.dialogs.PropertiesDialog import com.simplemobiletools.commons.dialogs.RenameItemDialog import com.simplemobiletools.commons.extensions.formatSize @@ -73,7 +74,8 @@ class ItemsAdapter(val activity: SimpleActivity, var mItems: MutableList displayRenameDialog() R.id.cab_properties -> showProperties() R.id.cab_share -> shareFiles() - R.id.cab_copy_move -> displayCopyDialog() + R.id.cab_copy_to -> copyMoveTo(true) + R.id.cab_move_to -> copyMoveTo(false) R.id.cab_delete -> askConfirmDelete() else -> return false } @@ -162,6 +164,22 @@ class ItemsAdapter(val activity: SimpleActivity, var mItems: MutableList() + val positions = multiSelector.selectedPositions + positions.forEach { files.add(File(mItems[it].path)) } + + val source = if (files[0].isFile) files[0].parent else files[0].absolutePath + FilePickerDialog(activity, source, false, config.showHidden, true) { + activity.copyMoveFilesTo(files, source, it, isCopyOperation, false) { + if (!isCopyOperation) { + listener?.refreshItems() + } + actMode?.finish() + } + } + } + private fun askConfirmDelete() { ConfirmationDialog(activity) { actMode?.finish() diff --git a/app/src/main/res/menu/cab.xml b/app/src/main/res/menu/cab.xml index ab29e0cc..a1c4d37b 100644 --- a/app/src/main/res/menu/cab.xml +++ b/app/src/main/res/menu/cab.xml @@ -17,10 +17,13 @@ android:title="@string/share" app:showAsAction="ifRoom"/> + android:id="@+id/cab_copy_to" + android:title="@string/copy_to" + app:showAsAction="never"/> +