fix #1523, check SAF dialog at restoring recycle bin items to SD cards
This commit is contained in:
parent
2de3e9abc4
commit
51260d351f
1 changed files with 7 additions and 3 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue