Loading build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ buildscript { propMinSdkVersion = 16 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 propVersionName = '3.12.8' propVersionName = '3.12.11' kotlin_version = '1.2.21' support_libs = '27.0.2' } Loading commons/src/main/kotlin/com/simplemobiletools/commons/asynctasks/CopyMoveTask.kt +2 −2 Original line number Diff line number Diff line Loading @@ -99,7 +99,7 @@ class CopyMoveTask(val activity: BaseSimpleActivity, val copyOnly: Boolean = fal } if (!copyOnly) { activity.deleteFiles(mTransferredFiles) {} activity.deleteFilesBg(mTransferredFiles) {} } val paths = mFiles.map { it.path } as ArrayList<String> Loading Loading @@ -183,7 +183,7 @@ class CopyMoveTask(val activity: BaseSimpleActivity, val copyOnly: Boolean = fal } val oldPath = "${source.path}/${child.name}" val oldFileDirItem = FileDirItem(oldPath, child.name, child.isDirectory) val oldFileDirItem = FileDirItem(oldPath, child.name, child.isDirectory, 0, child.length()) val newFileDirItem = FileDirItem(newPath, child.name, child.isDirectory) copy(oldFileDirItem, newFileDirItem) } Loading commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity.kt +3 −3 Original line number Diff line number Diff line Loading @@ -417,7 +417,7 @@ fun BaseSimpleActivity.deleteFileBg(fileDirItem: FileDirItem, allowDeleteFolder: val file = File(path) var fileDeleted = !isPathOnOTG(path) && (!file.exists() || file.delete()) if (fileDeleted) { rescanDeletedPath(fileDirItem.path) { rescanDeletedPath(path) { callback?.invoke(true) } } else { Loading @@ -427,10 +427,10 @@ fun BaseSimpleActivity.deleteFileBg(fileDirItem: FileDirItem, allowDeleteFolder: if (!fileDeleted) { if (isPathOnSD(path)) { handleSAFDialog(fileDirItem.path) { handleSAFDialog(path) { trySAFFileDelete(fileDirItem, allowDeleteFolder, callback) } } else if (isPathOnOTG(fileDirItem.path)) { } else if (isPathOnOTG(path)) { trySAFFileDelete(fileDirItem, allowDeleteFolder, callback) } } Loading commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context-storage.kt +6 −5 Original line number Diff line number Diff line Loading @@ -346,6 +346,7 @@ fun Context.trySAFFileDelete(fileDirItem: FileDirItem, allowDeleteFolder: Boolea if (document != null && (fileDirItem.isDirectory == document.isDirectory)) { fileDeleted = (document.isFile == true || allowDeleteFolder) && DocumentsContract.deleteDocument(applicationContext.contentResolver, document.uri) } } if (fileDeleted) { rescanDeletedPath(fileDirItem.path) { Loading @@ -353,9 +354,9 @@ fun Context.trySAFFileDelete(fileDirItem: FileDirItem, allowDeleteFolder: Boolea } } } } fun Context.getDoesFilePathExist(path: String) = if (isPathOnOTG(path)) getFastDocumentFile(path)?.exists() ?: false else File(path).exists() fun Context.getDoesFilePathExist(path: String) = if (isPathOnOTG(path)) getFastDocumentFile(path)?.exists() ?: false else File(path).exists() fun Context.getIsPathDirectory(path: String): Boolean { return if (isPathOnOTG(path)) { Loading commons/src/main/kotlin/com/simplemobiletools/commons/extensions/File.kt +1 −1 Original line number Diff line number Diff line Loading @@ -70,4 +70,4 @@ private fun getDirectoryFileCount(dir: File, countHiddenItems: Boolean): Int { fun File.getDirectChildrenCount(countHiddenItems: Boolean) = listFiles()?.filter { if (countHiddenItems) true else !it.isHidden }?.size ?: 0 fun File.toFileDirItem(context: Context) = FileDirItem(absolutePath, name, context.getIsPathDirectory(absolutePath), 0, 0L) fun File.toFileDirItem(context: Context) = FileDirItem(absolutePath, name, context.getIsPathDirectory(absolutePath), 0, length()) Loading
build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ buildscript { propMinSdkVersion = 16 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 propVersionName = '3.12.8' propVersionName = '3.12.11' kotlin_version = '1.2.21' support_libs = '27.0.2' } Loading
commons/src/main/kotlin/com/simplemobiletools/commons/asynctasks/CopyMoveTask.kt +2 −2 Original line number Diff line number Diff line Loading @@ -99,7 +99,7 @@ class CopyMoveTask(val activity: BaseSimpleActivity, val copyOnly: Boolean = fal } if (!copyOnly) { activity.deleteFiles(mTransferredFiles) {} activity.deleteFilesBg(mTransferredFiles) {} } val paths = mFiles.map { it.path } as ArrayList<String> Loading Loading @@ -183,7 +183,7 @@ class CopyMoveTask(val activity: BaseSimpleActivity, val copyOnly: Boolean = fal } val oldPath = "${source.path}/${child.name}" val oldFileDirItem = FileDirItem(oldPath, child.name, child.isDirectory) val oldFileDirItem = FileDirItem(oldPath, child.name, child.isDirectory, 0, child.length()) val newFileDirItem = FileDirItem(newPath, child.name, child.isDirectory) copy(oldFileDirItem, newFileDirItem) } Loading
commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity.kt +3 −3 Original line number Diff line number Diff line Loading @@ -417,7 +417,7 @@ fun BaseSimpleActivity.deleteFileBg(fileDirItem: FileDirItem, allowDeleteFolder: val file = File(path) var fileDeleted = !isPathOnOTG(path) && (!file.exists() || file.delete()) if (fileDeleted) { rescanDeletedPath(fileDirItem.path) { rescanDeletedPath(path) { callback?.invoke(true) } } else { Loading @@ -427,10 +427,10 @@ fun BaseSimpleActivity.deleteFileBg(fileDirItem: FileDirItem, allowDeleteFolder: if (!fileDeleted) { if (isPathOnSD(path)) { handleSAFDialog(fileDirItem.path) { handleSAFDialog(path) { trySAFFileDelete(fileDirItem, allowDeleteFolder, callback) } } else if (isPathOnOTG(fileDirItem.path)) { } else if (isPathOnOTG(path)) { trySAFFileDelete(fileDirItem, allowDeleteFolder, callback) } } Loading
commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context-storage.kt +6 −5 Original line number Diff line number Diff line Loading @@ -346,6 +346,7 @@ fun Context.trySAFFileDelete(fileDirItem: FileDirItem, allowDeleteFolder: Boolea if (document != null && (fileDirItem.isDirectory == document.isDirectory)) { fileDeleted = (document.isFile == true || allowDeleteFolder) && DocumentsContract.deleteDocument(applicationContext.contentResolver, document.uri) } } if (fileDeleted) { rescanDeletedPath(fileDirItem.path) { Loading @@ -353,9 +354,9 @@ fun Context.trySAFFileDelete(fileDirItem: FileDirItem, allowDeleteFolder: Boolea } } } } fun Context.getDoesFilePathExist(path: String) = if (isPathOnOTG(path)) getFastDocumentFile(path)?.exists() ?: false else File(path).exists() fun Context.getDoesFilePathExist(path: String) = if (isPathOnOTG(path)) getFastDocumentFile(path)?.exists() ?: false else File(path).exists() fun Context.getIsPathDirectory(path: String): Boolean { return if (isPathOnOTG(path)) { Loading
commons/src/main/kotlin/com/simplemobiletools/commons/extensions/File.kt +1 −1 Original line number Diff line number Diff line Loading @@ -70,4 +70,4 @@ private fun getDirectoryFileCount(dir: File, countHiddenItems: Boolean): Int { fun File.getDirectChildrenCount(countHiddenItems: Boolean) = listFiles()?.filter { if (countHiddenItems) true else !it.isHidden }?.size ?: 0 fun File.toFileDirItem(context: Context) = FileDirItem(absolutePath, name, context.getIsPathDirectory(absolutePath), 0, 0L) fun File.toFileDirItem(context: Context) = FileDirItem(absolutePath, name, context.getIsPathDirectory(absolutePath), 0, length())