wait for mediascanner at some callbacks
This commit is contained in:
parent
609cfbd580
commit
d0e81a3410
2 changed files with 8 additions and 6 deletions
|
@ -91,11 +91,12 @@ class CopyDialog(val activity: SimpleActivity, val files: ArrayList<File>, val c
|
|||
updatedFiles.add(destination)
|
||||
}
|
||||
|
||||
context.scanFiles(updatedFiles) {}
|
||||
context.scanFiles(updatedFiles) {
|
||||
dismiss()
|
||||
copyMoveListener.copySucceeded(true, files.size * 2 == updatedFiles.size)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,9 +4,9 @@ import android.app.AlertDialog
|
|||
import android.view.LayoutInflater
|
||||
import android.view.WindowManager
|
||||
import com.simplemobiletools.filepicker.extensions.*
|
||||
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.rename_file.view.*
|
||||
import java.io.File
|
||||
|
||||
|
@ -73,7 +73,8 @@ class RenameFileDialog(val activity: SimpleActivity, val file: File, val callbac
|
|||
|
||||
private fun sendSuccess(currFile: File, newFile: File) {
|
||||
val changedFiles = arrayListOf(currFile, newFile)
|
||||
activity.scanFiles(changedFiles) {}
|
||||
activity.scanFiles(changedFiles) {
|
||||
callback.invoke(newFile)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue