From bd3e196688781de35705aa1c386dedb60867bf1d Mon Sep 17 00:00:00 2001 From: gedoor Date: Mon, 5 Apr 2021 09:54:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E8=AE=A2=E9=98=85=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=9F=A5=E7=9C=8B=E6=BA=90=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rss/source/debug/RssSourceDebugActivity.kt | 18 ++++++++++++++++++ .../ui/rss/source/debug/RssSourceDebugModel.kt | 10 +++++++--- app/src/main/res/menu/book_source_debug.xml | 8 ++++---- app/src/main/res/menu/rss_source_debug.xml | 17 +++++++++++++++++ app/src/main/res/values-zh-rHK/strings.xml | 5 +++++ app/src/main/res/values-zh-rTW/strings.xml | 5 +++++ app/src/main/res/values-zh/strings.xml | 5 +++++ app/src/main/res/values/strings.xml | 5 +++++ 8 files changed, 66 insertions(+), 7 deletions(-) create mode 100644 app/src/main/res/menu/rss_source_debug.xml diff --git a/app/src/main/java/io/legado/app/ui/rss/source/debug/RssSourceDebugActivity.kt b/app/src/main/java/io/legado/app/ui/rss/source/debug/RssSourceDebugActivity.kt index e5cb45db4..4b790e5c1 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/debug/RssSourceDebugActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/debug/RssSourceDebugActivity.kt @@ -1,6 +1,8 @@ package io.legado.app.ui.rss.source.debug import android.os.Bundle +import android.view.Menu +import android.view.MenuItem import android.widget.SearchView import androidx.activity.viewModels import io.legado.app.R @@ -8,6 +10,7 @@ import io.legado.app.base.VMBaseActivity import io.legado.app.databinding.ActivitySourceDebugBinding import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.accentColor +import io.legado.app.ui.widget.dialog.TextDialog import io.legado.app.utils.gone import io.legado.app.utils.toastOnUi @@ -41,6 +44,21 @@ class RssSourceDebugActivity : VMBaseActivity + TextDialog.show(supportFragmentManager, viewModel.listSrc) + R.id.menu_content_src -> + TextDialog.show(supportFragmentManager, viewModel.contentSrc) + } + return super.onCompatOptionsItemSelected(item) + } + private fun initRecyclerView() { ATH.applyEdgeEffectColor(binding.recyclerView) adapter = RssSourceDebugAdapter(this) diff --git a/app/src/main/java/io/legado/app/ui/rss/source/debug/RssSourceDebugModel.kt b/app/src/main/java/io/legado/app/ui/rss/source/debug/RssSourceDebugModel.kt index 8ef97a780..9d1a5922a 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/debug/RssSourceDebugModel.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/debug/RssSourceDebugModel.kt @@ -8,10 +8,10 @@ import io.legado.app.model.Debug class RssSourceDebugModel(application: Application) : BaseViewModel(application), Debug.Callback { - private var rssSource: RssSource? = null - private var callback: ((Int, String) -> Unit)? = null + var listSrc: String? = null + var contentSrc: String? = null fun initData(sourceUrl: String?, finally: () -> Unit) { sourceUrl?.let { @@ -36,7 +36,11 @@ class RssSourceDebugModel(application: Application) : BaseViewModel(application) } override fun printLog(state: Int, msg: String) { - callback?.invoke(state, msg) + when (state) { + 10 -> listSrc = msg + 20 -> contentSrc = msg + else -> callback?.invoke(state, msg) + } } override fun onCleared() { diff --git a/app/src/main/res/menu/book_source_debug.xml b/app/src/main/res/menu/book_source_debug.xml index bcf7b3856..ec7878377 100644 --- a/app/src/main/res/menu/book_source_debug.xml +++ b/app/src/main/res/menu/book_source_debug.xml @@ -12,22 +12,22 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 1df7c6415..295a29b37 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -813,5 +813,10 @@ 系统TTS 导出格式 校验作者 + 搜索源码 + 书籍源码 + 目录源码 + 正文源码 + 列表源码 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 2920fcc23..245a0aeab 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -815,5 +815,10 @@ 系统TTS 导出格式 校验作者 + 搜索源码 + 书籍源码 + 目录源码 + 正文源码 + 列表源码 diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index f64b848d7..6ecebfe3e 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -817,5 +817,10 @@ 系统TTS 导出格式 校验作者 + 搜索源码 + 书籍源码 + 目录源码 + 正文源码 + 列表源码 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4cb2fa208..629f44767 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -820,5 +820,10 @@ System TTS 导出格式 校验作者 + 搜索源码 + 书籍源码 + 目录源码 + 正文源码 + 列表源码