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] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=AE=A2=E9=98=85=E9=87=8C?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=9B=BE=E7=89=87=E6=80=BB=E6=98=AF=E8=A6=81?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E4=BF=9D=E5=AD=98=E8=B7=AF=E5=BE=84=E7=9A=84?= =?UTF-8?q?BUG?= 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) }