at copy from the main screen, copy the directory content

This commit is contained in:
tibbi 2016-12-05 18:05:46 +01:00
parent a1f744864a
commit 2c9c91396a
2 changed files with 6 additions and 2 deletions

View file

@ -14,6 +14,7 @@ import com.bumptech.glide.signature.StringSignature
import com.simplemobiletools.filepicker.asynctasks.CopyMoveTask
import com.simplemobiletools.filepicker.dialogs.ConfirmationDialog
import com.simplemobiletools.filepicker.extensions.isAStorageRootFolder
import com.simplemobiletools.filepicker.extensions.isImageVideoGif
import com.simplemobiletools.filepicker.extensions.scanPaths
import com.simplemobiletools.filepicker.extensions.toast
import com.simplemobiletools.fileproperties.dialogs.PropertiesDialog
@ -165,7 +166,10 @@ class DirectoryAdapter(val activity: SimpleActivity, val dirs: MutableList<Direc
private fun displayCopyDialog() {
val files = ArrayList<File>()
val positions = multiSelector.selectedPositions
positions.forEach { files.add(File(dirs[it].path)) }
positions.forEach {
val dir = File(dirs[it].path)
files.addAll(dir.listFiles().filter { it.isFile && it.isImageVideoGif() })
}
CopyDialog(activity, files, object : CopyMoveTask.CopyMoveListener {
override fun copySucceeded(deleted: Boolean, copiedAll: Boolean) {

View file

@ -9,9 +9,9 @@ import com.simplemobiletools.filepicker.extensions.humanizePath
import com.simplemobiletools.filepicker.extensions.isPathOnSD
import com.simplemobiletools.filepicker.extensions.scanFiles
import com.simplemobiletools.filepicker.extensions.toast
import com.simplemobiletools.gallery.helpers.Config
import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.activities.SimpleActivity
import com.simplemobiletools.gallery.helpers.Config
import kotlinx.android.synthetic.main.dialog_copy_move.view.*
import java.io.File
import java.util.*