get the source path at copy/move from the first item
This commit is contained in:
parent
8d1145e038
commit
a963a13fc7
|
@ -18,8 +18,14 @@ open class SimpleActivity : BaseSimpleActivity() {
|
|||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
protected fun copyMoveFilesTo(source: String, files: ArrayList<File>, isCopyOperation: Boolean, callback: () -> Unit) {
|
||||
fun copyMoveFilesTo(files: ArrayList<File>, isCopyOperation: Boolean, callback: () -> Unit) {
|
||||
if (files.isEmpty()) {
|
||||
toast(R.string.unknown_error_occurred)
|
||||
return
|
||||
}
|
||||
|
||||
copyMoveCallback = callback
|
||||
val source = if (files[0].isFile) files[0].parent.trimEnd('/') else files[0].absolutePath
|
||||
val currPath = source.trimEnd('/')
|
||||
PickAlbumDialog(this, currPath) {
|
||||
val destinationFolder = File(it)
|
||||
|
|
|
@ -185,9 +185,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
}
|
||||
|
||||
private fun copyMoveTo(isCopyOperation: Boolean) {
|
||||
val currPath = File(getCurrentPath()).parent.trimEnd('/')
|
||||
val files = ArrayList<File>(1).apply { add(getCurrentFile()) }
|
||||
copyMoveFilesTo(currPath, files, isCopyOperation) {
|
||||
copyMoveFilesTo(files, isCopyOperation) {
|
||||
if (!isCopyOperation) {
|
||||
reloadViewPager()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue