diff --git a/app/build.gradle b/app/build.gradle index ecdde338..54fafd65 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -37,7 +37,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.33.1' + compile 'com.simplemobiletools:commons:2.33.2' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 58ce9866..721e8464 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -73,5 +73,15 @@ android:name="com.simplemobiletools.commons.activities.CustomizationActivity" android:label="@string/customize_colors" android:parentActivityName=".activities.SettingsActivity"/> + + + + diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/MainActivity.kt index 6a566a72..727ea4af 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/MainActivity.kt @@ -3,7 +3,6 @@ package com.simplemobiletools.filemanager.activities import android.app.Activity import android.content.ClipData import android.content.Intent -import android.net.Uri import android.os.Bundle import android.os.Handler import android.view.Menu @@ -223,16 +222,16 @@ class MainActivity : SimpleActivity() { fun pickedPath(path: String) { val resultIntent = Intent() - val uri = Uri.fromFile(File(path)) + val uri = getFilePublicUri(File(path), BuildConfig.APPLICATION_ID) val type = path.getMimeTypeFromPath() resultIntent.setDataAndTypeAndNormalize(uri, type) - resultIntent.flags = Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION + resultIntent.flags = Intent.FLAG_GRANT_READ_URI_PERMISSION setResult(Activity.RESULT_OK, resultIntent) finish() } fun pickedPaths(paths: ArrayList) { - val uris = paths.map { Uri.fromFile(File(it)) } as ArrayList + val uris = paths.map { getFilePublicUri(File(it), BuildConfig.APPLICATION_ID) } as ArrayList val clipData = ClipData("Attachment", arrayOf(uris.getMimeType()), ClipData.Item(uris.removeAt(0))) uris.forEach { 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 9e5639a9..a6e45fac 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt @@ -4,6 +4,7 @@ import android.content.Intent import android.graphics.drawable.Drawable import android.net.Uri import android.os.Build +import android.os.TransactionTooLargeException import android.support.v7.view.ActionMode import android.support.v7.widget.RecyclerView import android.util.SparseArray @@ -21,6 +22,7 @@ import com.simplemobiletools.commons.dialogs.PropertiesDialog import com.simplemobiletools.commons.dialogs.RenameItemDialog import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.models.FileDirItem +import com.simplemobiletools.filemanager.BuildConfig import com.simplemobiletools.filemanager.R import com.simplemobiletools.filemanager.activities.SimpleActivity import com.simplemobiletools.filemanager.dialogs.CompressAsDialog @@ -54,13 +56,14 @@ class ItemsAdapter(val activity: SimpleActivity, var mItems: MutableList + + + +