From 9f4fc59f796b750ae7b1c34b75f58b6cc3a2c600 Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 10 Aug 2021 09:50:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E7=BB=84=E6=B7=BB=E5=8A=A0=E5=B0=81?= =?UTF-8?q?=E9=9D=A2=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/help/ImageLoader.kt | 1 + .../main/java/io/legado/app/ui/book/group/GroupEditDialog.kt | 1 + .../io/legado/app/ui/main/bookshelf/style2/BooksAdapterGrid.kt | 1 + .../io/legado/app/ui/main/bookshelf/style2/BooksAdapterList.kt | 1 + .../main/java/io/legado/app/ui/widget/image/CoverImageView.kt | 2 +- .../java/io/legado/app/utils/ActivityResultContractUtils.kt | 2 +- 6 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/ImageLoader.kt b/app/src/main/java/io/legado/app/help/ImageLoader.kt index 15ff2b4cb..8b36f397d 100644 --- a/app/src/main/java/io/legado/app/help/ImageLoader.kt +++ b/app/src/main/java/io/legado/app/help/ImageLoader.kt @@ -12,6 +12,7 @@ import io.legado.app.utils.isAbsUrl import io.legado.app.utils.isContentScheme import java.io.File +@Suppress("unused") object ImageLoader { /** diff --git a/app/src/main/java/io/legado/app/ui/book/group/GroupEditDialog.kt b/app/src/main/java/io/legado/app/ui/book/group/GroupEditDialog.kt index 8079c853d..7a0e1f9ab 100644 --- a/app/src/main/java/io/legado/app/ui/book/group/GroupEditDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/group/GroupEditDialog.kt @@ -69,6 +69,7 @@ class GroupEditDialog : BaseDialogFragment() { } ?: let { binding.toolBar.title = getString(R.string.add_group) binding.btnDelete.gone() + binding.ivCover.load() } binding.run { ivCover.onClick { diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/style2/BooksAdapterGrid.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/style2/BooksAdapterGrid.kt index 3ac98ea46..2ffe196ce 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/style2/BooksAdapterGrid.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/style2/BooksAdapterGrid.kt @@ -89,6 +89,7 @@ class BooksAdapterGrid(context: Context, callBack: CallBack) : val item = callBack.getItem(position) if (item is BookGroup) { tvName.text = item.groupName + ivCover.load(item.cover) } root.setOnClickListener { callBack.onItemClick(position) diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/style2/BooksAdapterList.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/style2/BooksAdapterList.kt index fccddaf35..371628ae6 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/style2/BooksAdapterList.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/style2/BooksAdapterList.kt @@ -91,6 +91,7 @@ class BooksAdapterList(context: Context, callBack: CallBack) : val item = callBack.getItem(position) if (item is BookGroup) { tvName.text = item.groupName + ivCover.load(item.cover) flHasNew.gone() ivAuthor.gone() ivLast.gone() diff --git a/app/src/main/java/io/legado/app/ui/widget/image/CoverImageView.kt b/app/src/main/java/io/legado/app/ui/widget/image/CoverImageView.kt index 91a80a35b..986ac63e4 100644 --- a/app/src/main/java/io/legado/app/ui/widget/image/CoverImageView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/image/CoverImageView.kt @@ -133,7 +133,7 @@ class CoverImageView @JvmOverloads constructor( } } - fun load(path: String?, name: String? = null, author: String? = null) { + fun load(path: String? = null, name: String? = null, author: String? = null) { this.path = path setText(name, author) if (AppConfig.useDefaultCover) { diff --git a/app/src/main/java/io/legado/app/utils/ActivityResultContractUtils.kt b/app/src/main/java/io/legado/app/utils/ActivityResultContractUtils.kt index 3f0198023..66d15a888 100644 --- a/app/src/main/java/io/legado/app/utils/ActivityResultContractUtils.kt +++ b/app/src/main/java/io/legado/app/utils/ActivityResultContractUtils.kt @@ -14,7 +14,7 @@ object ActivityResultContractUtils { override fun createIntent(context: Context, input: Int?): Intent { requestCode = input - return Intent(Intent.ACTION_GET_CONTENT) + return Intent(Intent.ACTION_OPEN_DOCUMENT) .addCategory(Intent.CATEGORY_OPENABLE) .setType("image/*") }