From ee2dff25936fc12afa32338ce1825e69dfdcc6cf Mon Sep 17 00:00:00 2001 From: gedoor Date: Thu, 22 Jul 2021 23:15:13 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E5=AF=BC=E5=85=A5=E5=85=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 33 ++----------------- .../ui/association/OnLineImportActivity.kt | 24 +++++++++----- .../legado/app/ui/rss/read/ReadRssActivity.kt | 25 ++------------ 3 files changed, 22 insertions(+), 60 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index fea75c6a4..2da0a69a1 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -341,9 +341,9 @@ - + + + @@ -351,48 +351,21 @@ android:name=".ui.association.ImportBookSourceActivity" android:configChanges="locale|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout" android:theme="@style/AppTheme.Transparent"> - - - - - - - - - - - - - - - - - - - - - importBookSource(url) - "rssSource" -> importRssSource(url) - "replaceRule" -> importReplaceRule(url) - "textTocRule" -> viewModel.importTextTocRule(url, this::finallyDialog) - "httpTTS" -> viewModel.importHttpTTS(url, this::finallyDialog) - "theme" -> viewModel.importTheme(url, this::finallyDialog) - "readConfig" -> viewModel.importReadConfig(url, this::finallyDialog) - else -> { + "/bookSource" -> importBookSource(url) + "/rssSource" -> importRssSource(url) + "/replaceRule" -> importReplaceRule(url) + "/textTocRule" -> viewModel.importTextTocRule(url, this::finallyDialog) + "/httpTTS" -> viewModel.importHttpTTS(url, this::finallyDialog) + "/theme" -> viewModel.importTheme(url, this::finallyDialog) + "/readConfig" -> viewModel.importReadConfig(url, this::finallyDialog) + "/importonline" -> when (it.host) { + "booksource" -> importBookSource(url) + "rsssource" -> importRssSource(url) + "replace" -> importReplaceRule(url) + else -> { + toastOnUi("url error") + finish() + } } } } 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 9884af35e..ecadd4519 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 @@ -22,9 +22,6 @@ import io.legado.app.help.AppConfig import io.legado.app.lib.theme.DrawableUtils import io.legado.app.lib.theme.primaryTextColor import io.legado.app.service.help.Download -import io.legado.app.ui.association.ImportBookSourceActivity -import io.legado.app.ui.association.ImportReplaceRuleActivity -import io.legado.app.ui.association.ImportRssSourceActivity import io.legado.app.ui.association.OnLineImportActivity import io.legado.app.ui.document.FilePicker import io.legado.app.ui.document.FilePickerParam @@ -336,25 +333,9 @@ class ReadRssActivity : VMBaseActivity "http", "https" -> { return false } - "legado" -> { - when (url.host) { - "import" -> startActivity { - data = url - } - } - return true - } - "yuedu" -> { - when (url.host) { - "booksource" -> startActivity { - data = url - } - "rsssource" -> startActivity { - data = url - } - "replace" -> startActivity { - data = url - } + "legado", "yuedu" -> { + startActivity { + data = url } return true }