Loading build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ buildscript { propMinSdkVersion = 21 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 propVersionName = '5.1.15' propVersionName = '5.1.17' kotlin_version = '1.2.71' } Loading commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity.kt +5 −0 Original line number Diff line number Diff line Loading @@ -487,6 +487,11 @@ fun BaseSimpleActivity.deleteFile(fileDirItem: FileDirItem, allowDeleteFolder: B fun BaseSimpleActivity.deleteFileBg(fileDirItem: FileDirItem, allowDeleteFolder: Boolean = false, callback: ((wasSuccess: Boolean) -> Unit)? = null) { val path = fileDirItem.path val file = File(path) if (!file.canWrite()) { callback?.invoke(false) return } var fileDeleted = !path.startsWith(OTG_PATH) && ((!file.exists() && file.length() == 0L) || file.delete()) if (fileDeleted) { rescanDeletedPath(path) { Loading Loading
build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ buildscript { propMinSdkVersion = 21 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 propVersionName = '5.1.15' propVersionName = '5.1.17' kotlin_version = '1.2.71' } Loading
commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity.kt +5 −0 Original line number Diff line number Diff line Loading @@ -487,6 +487,11 @@ fun BaseSimpleActivity.deleteFile(fileDirItem: FileDirItem, allowDeleteFolder: B fun BaseSimpleActivity.deleteFileBg(fileDirItem: FileDirItem, allowDeleteFolder: Boolean = false, callback: ((wasSuccess: Boolean) -> Unit)? = null) { val path = fileDirItem.path val file = File(path) if (!file.canWrite()) { callback?.invoke(false) return } var fileDeleted = !path.startsWith(OTG_PATH) && ((!file.exists() && file.length() == 0L) || file.delete()) if (fileDeleted) { rescanDeletedPath(path) { Loading