From 11fe757354799776fbfae4a364f6ba79dc496dae Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 14 Mar 2022 23:50:50 +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 --- .../main/java/io/legado/app/constant/AppConst.kt | 13 ------------- .../ui/book/source/edit/BookSourceEditActivity.kt | 6 ++++-- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/io/legado/app/constant/AppConst.kt b/app/src/main/java/io/legado/app/constant/AppConst.kt index 87461bb76..d8c5b2d00 100644 --- a/app/src/main/java/io/legado/app/constant/AppConst.kt +++ b/app/src/main/java/io/legado/app/constant/AppConst.kt @@ -51,19 +51,6 @@ object AppConst { const val notificationIdDownload = -1122395 const val notificationIdCheckSource = -1122395 - val urlOption: String by lazy { - """ - ,{ - 'charset': '', - 'method': 'POST', - 'body': '', - 'headers': { - 'User-Agent': '' - } - } - """.trimIndent() - } - val menuViewNames = arrayOf( "com.android.internal.view.menu.ListMenuItemView", "androidx.appcompat.view.menu.ListMenuItemView" diff --git a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt index b5f472eb8..9b58c9a44 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt @@ -11,7 +11,6 @@ import com.google.android.material.tabs.TabLayout import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel import io.legado.app.R import io.legado.app.base.VMBaseActivity -import io.legado.app.constant.AppConst import io.legado.app.constant.BookType import io.legado.app.data.entities.BookSource import io.legado.app.data.entities.rule.* @@ -26,6 +25,7 @@ import io.legado.app.ui.document.HandleFileContract import io.legado.app.ui.login.SourceLoginActivity import io.legado.app.ui.qrcode.QrCodeResult import io.legado.app.ui.widget.dialog.TextDialog +import io.legado.app.ui.widget.dialog.UrlOptionDialog import io.legado.app.ui.widget.keyboard.KeyboardToolPop import io.legado.app.utils.* import io.legado.app.utils.viewbindingdelegate.viewBinding @@ -447,7 +447,9 @@ class BookSourceEditActivity : override fun onHelpActionSelect(action: String) { when (action) { - "urlOption" -> sendText(AppConst.urlOption) + "urlOption" -> UrlOptionDialog(this) { + sendText(it) + }.show() "ruleHelp" -> showHelp("ruleHelp") "jsHelp" -> showHelp("jsHelp") "regexHelp" -> showHelp("regexHelp")