From 8152b4e87976f4e8a5979ab9037b458dc2f4ff24 Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 28 Feb 2020 10:01:28 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 14 ++++++++++++-- .../ui/rss/source/manage/RssSourceActivity.kt | 17 +++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a8ebd70da..563605c91 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -142,7 +142,6 @@ - @@ -152,7 +151,18 @@ - + + + + + + + + + + diff --git a/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt b/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt index 517290130..22277476e 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt @@ -57,6 +57,7 @@ class RssSourceActivity : VMBaseActivity(R.layout.activity_r private var groupMenu: SubMenu? = null override fun onActivityCreated(savedInstanceState: Bundle?) { + initUriScheme() initRecyclerView() initSearchView() initLiveDataGroup() @@ -102,6 +103,22 @@ class RssSourceActivity : VMBaseActivity(R.layout.activity_r return true } + private fun initUriScheme() { + intent.data?.let { + when (it.path) { + "/importonline" -> it.getQueryParameter("src")?.let { url -> + Snackbar.make(title_bar, R.string.importing, Snackbar.LENGTH_INDEFINITE).show() + viewModel.importSource(url) { msg -> + title_bar.snackbar(msg) + } + } + else -> { + toast("格式不对") + } + } + } + } + private fun initRecyclerView() { ATH.applyEdgeEffectColor(recycler_view) recycler_view.layoutManager = LinearLayoutManager(this)