From b04442f3ec3201149678a7351826a78883467c2e Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 10 May 2020 18:56:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 3 +++ .../ui/book/info/edit/BookInfoEditActivity.kt | 16 +--------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index b33892324..6b2bafdd8 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -3,6 +3,9 @@ xmlns:tools="http://schemas.android.com/tools" package="io.legado.app"> + diff --git a/app/src/main/java/io/legado/app/ui/book/info/edit/BookInfoEditActivity.kt b/app/src/main/java/io/legado/app/ui/book/info/edit/BookInfoEditActivity.kt index f7ff39be4..70b945efe 100644 --- a/app/src/main/java/io/legado/app/ui/book/info/edit/BookInfoEditActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/info/edit/BookInfoEditActivity.kt @@ -9,10 +9,7 @@ import androidx.lifecycle.Observer import io.legado.app.R import io.legado.app.base.VMBaseActivity import io.legado.app.data.entities.Book -import io.legado.app.help.permission.Permissions -import io.legado.app.help.permission.PermissionsCompat import io.legado.app.ui.book.changecover.ChangeCoverDialog -import io.legado.app.utils.RealPathUtil import io.legado.app.utils.getViewModel import kotlinx.android.synthetic.main.activity_book_info_edit.* import org.jetbrains.anko.sdk27.listeners.onClick @@ -110,18 +107,7 @@ class BookInfoEditActivity : resultSelectCover -> { if (resultCode == Activity.RESULT_OK) { data?.data?.let { uri -> - RealPathUtil.getPath(this, uri)?.let { path -> - PermissionsCompat.Builder(this) - .addPermissions( - Permissions.READ_EXTERNAL_STORAGE, - Permissions.WRITE_EXTERNAL_STORAGE - ) - .rationale(R.string.get_storage_per) - .onGranted { - coverChangeTo(path) - } - .request() - } + coverChangeTo(uri.toString()) } } }