mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 14:37:59 +01:00
reimplement copy and move at folder and thumbnail views
This commit is contained in:
parent
bc54d58dbe
commit
ed59c51b99
3 changed files with 21 additions and 7 deletions
|
@ -32,7 +32,7 @@ android {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
compile 'com.simplemobiletools:commons:2.14.9'
|
||||
compile 'com.simplemobiletools:commons:2.15.0'
|
||||
compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0'
|
||||
compile 'com.theartofdev.edmodo:android-image-cropper:2.3.1'
|
||||
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'
|
||||
|
|
|
@ -224,7 +224,7 @@ class DirectoryAdapter(val activity: SimpleActivity, val dirs: MutableList<Direc
|
|||
actMode?.finish()
|
||||
}
|
||||
|
||||
private fun displayCopyDialog() {
|
||||
private fun copyMoveTo(isCopyOperation: Boolean) {
|
||||
val files = ArrayList<File>()
|
||||
val positions = multiSelector.selectedPositions
|
||||
if (positions.isEmpty())
|
||||
|
@ -234,14 +234,21 @@ class DirectoryAdapter(val activity: SimpleActivity, val dirs: MutableList<Direc
|
|||
val dir = File(dirs[it].path)
|
||||
files.addAll(dir.listFiles().filter { it.isFile && it.isImageVideoGif() })
|
||||
}
|
||||
|
||||
activity.copyMoveFilesTo(files, isCopyOperation) {
|
||||
if (!isCopyOperation) {
|
||||
listener?.refreshItems()
|
||||
}
|
||||
actMode?.finish()
|
||||
}
|
||||
}
|
||||
|
||||
private fun copyTo() {
|
||||
|
||||
copyMoveTo(true)
|
||||
}
|
||||
|
||||
private fun moveTo() {
|
||||
|
||||
copyMoveTo(false)
|
||||
}
|
||||
|
||||
fun selectAll() {
|
||||
|
|
|
@ -137,18 +137,25 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
|
|||
}
|
||||
}
|
||||
|
||||
private fun displayCopyDialog() {
|
||||
private fun copyMoveTo(isCopyOperation: Boolean) {
|
||||
val files = ArrayList<File>()
|
||||
val positions = multiSelector.selectedPositions
|
||||
positions.forEach { files.add(File(media[it].path)) }
|
||||
|
||||
activity.copyMoveFilesTo(files, isCopyOperation) {
|
||||
if (!isCopyOperation) {
|
||||
listener?.refreshItems()
|
||||
}
|
||||
actMode?.finish()
|
||||
}
|
||||
}
|
||||
|
||||
private fun copyTo() {
|
||||
|
||||
copyMoveTo(true)
|
||||
}
|
||||
|
||||
private fun moveTo() {
|
||||
|
||||
copyMoveTo(false)
|
||||
}
|
||||
|
||||
fun selectAll() {
|
||||
|
|
Loading…
Reference in a new issue