From 373d062cd4501ab158a92e571a9df73e260c5f75 Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 28 Feb 2020 14:11:52 +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 | 33 ++++++++++++++----- .../app/ui/replacerule/ReplaceRuleActivity.kt | 17 ++++++++++ 2 files changed, 41 insertions(+), 9 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 563605c91..ba4789e2c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -123,9 +123,6 @@ - @@ -135,8 +132,8 @@ - - + + @@ -147,10 +144,7 @@ android:scheme="yuedu" /> - - - - + @@ -163,6 +157,27 @@ android:scheme="yuedu" /> + + + + + + + + + + + + + + + + + diff --git a/app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleActivity.kt b/app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleActivity.kt index 331c87a5d..5044e2667 100644 --- a/app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleActivity.kt +++ b/app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleActivity.kt @@ -55,6 +55,7 @@ class ReplaceRuleActivity : VMBaseActivity(R.layout.activi private var dataInit = false override fun onActivityCreated(savedInstanceState: Bundle?) { + initUriScheme() initRecyclerView() initSearchView() initSelectActionView() @@ -73,6 +74,22 @@ class ReplaceRuleActivity : VMBaseActivity(R.layout.activi return super.onPrepareOptionsMenu(menu) } + 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)