From 13a6762d9b3c81e88acf62806b6b7674676284ed Mon Sep 17 00:00:00 2001 From: NineWorlds <1365887550@qq.com> Date: Tue, 27 Jul 2021 09:02:19 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=AD=A3epub=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E6=97=B6=E5=9B=BE=E7=89=87=E6=96=87=E5=AD=97=E6=B7=B7=E5=90=88?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E9=94=99=E8=AF=AF=EF=BC=9A=20=E5=A4=9A?= =?UTF-8?q?=E7=9C=8B=E5=8D=95=E5=9B=BE=E4=BC=98=E5=8C=96=E4=B8=8D=E9=80=82?= =?UTF-8?q?=E7=94=A8=E4=BA=8E=E6=89=80=E6=9C=89=E5=9C=BA=E6=99=AF=EF=BC=8C?= =?UTF-8?q?=E7=BC=A9=E5=B0=8F=E6=9C=89=E6=95=88=E8=8C=83=E5=9B=B4=E4=B8=BA?= =?UTF-8?q?=E6=AE=B5=E8=90=BD=E5=8D=95=E5=9B=BE=EF=BC=8C=E6=8F=90=E9=AB=98?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E6=80=A7=E3=80=82

=E5=86=85=E5=8C=85?= =?UTF-8?q?=E5=90=AB

=E4=B8=8D=E5=90=88=E8=A7=84=E8=8C=83=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A5=E7=AC=A6=E5=90=88=E8=A7=84=E8=8C=83?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/me/ag2s/epublib/util/StringUtil.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/epublib/src/main/java/me/ag2s/epublib/util/StringUtil.java b/epublib/src/main/java/me/ag2s/epublib/util/StringUtil.java index 35f3fcd2b..b989afb24 100644 --- a/epublib/src/main/java/me/ag2s/epublib/util/StringUtil.java +++ b/epublib/src/main/java/me/ag2s/epublib/util/StringUtil.java @@ -279,10 +279,10 @@ public class StringUtil { for (String s : text.split("\\r?\\n")) { s = s.replaceAll("^\\s+|\\s+$", ""); if (s.length() > 0) { - if (s.toLowerCase().contains("]+)/?>", "
"); - } - if (!(s.startsWith(""))) { + //段落为一张图片才认定为图片章节/漫画并启用多看单图优化,否则认定为普通文字夹杂着的图片文字。 + if (s.matches("(?i)^]+)/?>$")) { + body.append(s.replaceAll("(?i)^]+)/?>$", "
")); } + else{ body.append("

").append(s).append("

"); } } From 5155633e4ec1008889f0751c888bb9acbe8fb055 Mon Sep 17 00:00:00 2001 From: NineWorlds <1365887550@qq.com> Date: Tue, 27 Jul 2021 11:01:29 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=AE=A2=E9=98=85?= =?UTF-8?q?=E9=87=8C=E4=BF=9D=E5=AD=98=E5=9B=BE=E7=89=87=E6=80=BB=E6=98=AF?= =?UTF-8?q?=E8=A6=81=E9=80=89=E6=8B=A9=E4=BF=9D=E5=AD=98=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/rss/read/ReadRssActivity.kt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt index 607aeaf7e..066cf6219 100644 --- a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt @@ -37,7 +37,7 @@ class ReadRssActivity : VMBaseActivity override val binding by viewBinding(ActivityRssReadBinding::inflate) override val viewModel by viewModels() - private val imagePathKey = "" + private val imagePathKey = "imagePath" private var starMenuItem: MenuItem? = null private var ttsMenuItem: MenuItem? = null private var customWebViewCallback: WebChromeClient.CustomViewCallback? = null @@ -155,8 +155,16 @@ class ReadRssActivity : VMBaseActivity } private fun saveImage() { + val path = ACache.get(this@ReadRssActivity).getAsString(imagePathKey) + if (path.isNullOrEmpty()) { + selectExportFolder() + } else { + viewModel.saveImage(webPic, path) + } + } + private fun selectExportFolder() { val default = arrayListOf() - val path = ACache.get(this).getAsString(imagePathKey) + val path = ACache.get(this@ReadRssActivity).getAsString(imagePathKey) if (!path.isNullOrEmpty()) { default.add(path) }