From 6c8f1609b20d2714353ca0765f63aab4e82158d9 Mon Sep 17 00:00:00 2001 From: gedoor Date: Mon, 8 Mar 2021 10:09:02 +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 --- app/src/main/assets/defaultData/rssSources.json | 9 +++++++++ .../java/io/legado/app/ui/main/rss/RssFragment.kt | 11 ++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/app/src/main/assets/defaultData/rssSources.json b/app/src/main/assets/defaultData/rssSources.json index b4b2a70e0..bc1754b59 100644 --- a/app/src/main/assets/defaultData/rssSources.json +++ b/app/src/main/assets/defaultData/rssSources.json @@ -17,5 +17,14 @@ "sourceName": "阅读下载", "sourceUrl": "https:\/\/github.com\/gedoor\/legado\/releases", "style": "" + }, + { + "customOrder": 1, + "enableJs": true, + "enabled": true, + "singleUrl": true, + "sourceIcon": "http:\/\/mmbiz.qpic.cn\/mmbiz_png\/hpfMV8hEuL2eS6vnCxvTzoOiaCAibV6exBzJWq9xMic9xDg3YXAick87tsfafic0icRwkQ5ibV0bJ84JtSuxhPuEDVquA\/0?wx_fmt=png", + "sourceName": "小说拾遗", + "sourceUrl": "snssdk1128:\/\/user\/profile\/562564899806367" } ] \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/main/rss/RssFragment.kt b/app/src/main/java/io/legado/app/ui/main/rss/RssFragment.kt index 039c54f75..6441cea91 100644 --- a/app/src/main/java/io/legado/app/ui/main/rss/RssFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/rss/RssFragment.kt @@ -25,6 +25,7 @@ import io.legado.app.ui.rss.source.manage.RssSourceActivity import io.legado.app.ui.rss.source.manage.RssSourceViewModel import io.legado.app.ui.rss.subscription.RuleSubActivity import io.legado.app.utils.cnCompare +import io.legado.app.utils.openUrl import io.legado.app.utils.splitNotBlank import io.legado.app.utils.startActivity import io.legado.app.utils.viewbindingdelegate.viewBinding @@ -143,9 +144,13 @@ class RssFragment : VMBaseFragment(R.layout.fragment_rss), override fun openRss(rssSource: RssSource) { if (rssSource.singleUrl) { - startActivity { - putExtra("title", rssSource.sourceName) - putExtra("origin", rssSource.sourceUrl) + if (rssSource.sourceUrl.startsWith("http", true)) { + startActivity { + putExtra("title", rssSource.sourceName) + putExtra("origin", rssSource.sourceUrl) + } + } else { + context?.openUrl(rssSource.sourceUrl) } } else { startActivity {