From e0703acd9dfee965f3b43e10058e8e12e0e8fe86 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 22 Oct 2017 22:56:40 +0200 Subject: [PATCH] use the Commons way of determining mimetype of multiple uris --- app/build.gradle | 2 +- .../filemanager/adapters/ItemsAdapter.kt | 15 +-------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index e6267f0f..b6fca3ce 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -37,7 +37,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.30.10' + compile 'com.simplemobiletools:commons:2.30.13' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" 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 a2cdfc17..7106cbc1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt @@ -179,7 +179,7 @@ class ItemsAdapter(val activity: SimpleActivity, var mItems: MutableList): String { - val firstMimeType = uris.first().path.getMimeTypeFromPath() - val firstMimeGroup = firstMimeType.substringBefore("/") - - uris.forEach { - val mimeGroup = it.path.getMimeTypeFromPath().substringBefore("/") - if (mimeGroup != firstMimeGroup) { - return "*/*" - } - } - return firstMimeType - } - private fun copyMoveTo(isCopyOperation: Boolean) { val files = ArrayList() selectedPositions.forEach { files.add(File(mItems[it].path)) }