修正订阅里保存图片总是要选择保存路径的BUG

pull/1174/head
NineWorlds 3 years ago
parent 13a6762d9b
commit 5155633e4e
  1. 12
      app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt

@ -37,7 +37,7 @@ class ReadRssActivity : VMBaseActivity<ActivityRssReadBinding, ReadRssViewModel>
override val binding by viewBinding(ActivityRssReadBinding::inflate)
override val viewModel by viewModels<ReadRssViewModel>()
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<ActivityRssReadBinding, ReadRssViewModel>
}
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<String>()
val path = ACache.get(this).getAsString(imagePathKey)
val path = ACache.get(this@ReadRssActivity).getAsString(imagePathKey)
if (!path.isNullOrEmpty()) {
default.add(path)
}

Loading…
Cancel
Save