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 导出格式 校验作者 + 搜索源码 + 书籍源码 + 目录源码 + 正文源码 + 列表源码