From 57f3220fb6827f9ed8208b7029a6c2a97287c1b7 Mon Sep 17 00:00:00 2001 From: gedoor Date: Mon, 19 Oct 2020 21:07:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../legado/app/ui/book/read/config/BgTextConfigDialog.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt index 69070e27b..a41bf4003 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt @@ -119,7 +119,7 @@ class BgTextConfigDialog : BaseDialogFragment(), FileChooserDialog.CallBack { headerView.iv_bg.setImageResource(R.drawable.ic_image) headerView.iv_bg.setColorFilter(primaryTextColor) headerView.onClick { selectImage() } - requireContext().assets.list("bg/")?.let { + requireContext().assets.list("bg${File.separator}")?.let { adapter.setItems(it.toList()) } } @@ -194,7 +194,10 @@ class BgTextConfigDialog : BaseDialogFragment(), FileChooserDialog.CallBack { override fun convert(holder: ItemViewHolder, item: String, payloads: MutableList) { with(holder.itemView) { - ImageLoader.load(context, context.assets.open("bg/$item").readBytes()) + ImageLoader.load( + context, + context.assets.open("bg${File.separator}$item").readBytes() + ) .centerCrop() .into(iv_bg) tv_name.setTextColor(secondaryTextColor)