From ce63adf6f187d8b70e049640d147bdcc721c59ee Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 3 Sep 2017 10:23:32 +0200 Subject: [PATCH] fix decompressing folders on sd cards --- .../filemanager/adapters/ItemsAdapter.kt | 44 +++++++------------ 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt index 17e39c48..d4d8ca79 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt @@ -241,15 +241,17 @@ class ItemsAdapter(val activity: SimpleActivity, var mItems: MutableList Unit) { + private fun createDirectorySync(file: File): Boolean { if (activity.needsStupidWritePermissions(file.absolutePath)) { - activity.handleSAFDialog(file) { - val documentFile = activity.getFileDocument(file.absolutePath) - if (documentFile == null) { - callback(false) - return@handleSAFDialog - } - val newDir = documentFile.createDirectory(file.name) - callback(newDir != null) - } - } else { - callback(file.mkdirs()) + val documentFile = activity.getFileDocument(file.absolutePath) ?: return false + val newDir = documentFile.createDirectory(file.name) + return newDir != null } + return file.mkdirs() } fun zipPaths(sourcePaths: List, targetPath: String): Boolean {