mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
fix #1523, check SAF dialog at restoring recycle bin items to SD cards
This commit is contained in:
@ -256,11 +256,15 @@ fun BaseSimpleActivity.restoreRecycleBinPath(path: String, callback: () -> Unit)
|
|||||||
fun BaseSimpleActivity.restoreRecycleBinPaths(paths: ArrayList<String>, mediumDao: MediumDao = galleryDB.MediumDao(), callback: () -> Unit) {
|
fun BaseSimpleActivity.restoreRecycleBinPaths(paths: ArrayList<String>, mediumDao: MediumDao = galleryDB.MediumDao(), callback: () -> Unit) {
|
||||||
ensureBackgroundThread {
|
ensureBackgroundThread {
|
||||||
val newPaths = ArrayList<String>()
|
val newPaths = ArrayList<String>()
|
||||||
paths.forEach {
|
for (source in paths) {
|
||||||
val source = it
|
val destination = source.removePrefix(recycleBinPath)
|
||||||
val destination = it.removePrefix(recycleBinPath)
|
|
||||||
val lastModified = File(source).lastModified()
|
val lastModified = File(source).lastModified()
|
||||||
|
|
||||||
|
val isShowingSAF = handleSAFDialog(destination) {}
|
||||||
|
if (isShowingSAF) {
|
||||||
|
return@ensureBackgroundThread
|
||||||
|
}
|
||||||
|
|
||||||
var inputStream: InputStream? = null
|
var inputStream: InputStream? = null
|
||||||
var out: OutputStream? = null
|
var out: OutputStream? = null
|
||||||
try {
|
try {
|
||||||
|
Reference in New Issue
Block a user