rescan files after renaming
This commit is contained in:
parent
0075346411
commit
9f143f2be6
2 changed files with 12 additions and 3 deletions
|
@ -29,5 +29,5 @@ ext {
|
|||
propMinSdkVersion = 16
|
||||
propTargetSdkVersion = propCompileSdkVersion
|
||||
propVersionCode = 1
|
||||
propVersionName = '2.18.1'
|
||||
propVersionName = '2.18.2'
|
||||
}
|
||||
|
|
|
@ -269,11 +269,20 @@ fun BaseSimpleActivity.renameFile(oldFile: File, newFile: File, callback: (succe
|
|||
return@handleSAFDialog
|
||||
}
|
||||
|
||||
callback(document.canWrite() && document.renameTo(newFile.name))
|
||||
val success = document.canWrite() && document.renameTo(newFile.name)
|
||||
if (success) {
|
||||
scanFiles(arrayListOf(oldFile, newFile)) {
|
||||
callback(true)
|
||||
}
|
||||
} else {
|
||||
callback(false)
|
||||
}
|
||||
}
|
||||
} else if (oldFile.renameTo(newFile)) {
|
||||
newFile.setLastModified(System.currentTimeMillis())
|
||||
callback(true)
|
||||
scanFiles(arrayListOf(oldFile, newFile)) {
|
||||
callback(true)
|
||||
}
|
||||
} else {
|
||||
callback(false)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue