pull/1352/head
gedoor 3 years ago
parent ece352381c
commit 6965b6ad44
  1. 2
      app/src/main/java/io/legado/app/data/entities/BookSource.kt
  2. 6
      app/src/main/java/io/legado/app/ui/book/source/debug/BookSourceDebugActivity.kt
  3. 5
      app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt

@ -92,7 +92,7 @@ data class BookSource(
} }
} }
}.onFailure { }.onFailure {
kinds.add(ExploreKind(it.localizedMessage ?: "")) kinds.add(ExploreKind("ERROR:${it.localizedMessage}", it.stackTraceToString()))
AppLog.put("解析发现规则出错\n${it.localizedMessage}", it) AppLog.put("解析发现规则出错\n${it.localizedMessage}", it)
it.printOnDebug() it.printOnDebug()
} }

@ -90,6 +90,10 @@ class BookSourceDebugActivity : VMBaseActivity<ActivitySourceDebugBinding, BookS
!it.url.isNullOrBlank() !it.url.isNullOrBlank()
}?.let { }?.let {
binding.textFx.text = "${it.title}::${it.url}" binding.textFx.text = "${it.title}::${it.url}"
if (it.title.startsWith("ERROR:")) {
adapter.addItem("获取发现出错\n${it.url}")
openOrCloseHelp(false)
}
} }
binding.textMy.onClick { binding.textMy.onClick {
searchView.setQuery(binding.textMy.text, true) searchView.setQuery(binding.textMy.text, true)
@ -98,9 +102,11 @@ class BookSourceDebugActivity : VMBaseActivity<ActivitySourceDebugBinding, BookS
searchView.setQuery(binding.textXt.text, true) searchView.setQuery(binding.textXt.text, true)
} }
binding.textFx.onClick { binding.textFx.onClick {
if (!binding.textFx.text.startsWith("ERROR:")) {
searchView.setQuery(binding.textFx.text, true) searchView.setQuery(binding.textFx.text, true)
} }
} }
}
/** /**
* 打开关闭历史界面 * 打开关闭历史界面

@ -18,6 +18,7 @@ import io.legado.app.databinding.ItemFindBookBinding
import io.legado.app.help.coroutine.Coroutine import io.legado.app.help.coroutine.Coroutine
import io.legado.app.lib.theme.accentColor import io.legado.app.lib.theme.accentColor
import io.legado.app.ui.login.SourceLoginActivity import io.legado.app.ui.login.SourceLoginActivity
import io.legado.app.ui.widget.dialog.TextDialog
import io.legado.app.utils.* import io.legado.app.utils.*
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import splitties.views.onLongClick import splitties.views.onLongClick
@ -95,12 +96,16 @@ class ExploreAdapter(context: Context, private val scope: CoroutineScope, val ca
tv.setOnClickListener(null) tv.setOnClickListener(null)
} else { } else {
tv.setOnClickListener { tv.setOnClickListener {
if (kind.title.startsWith("ERROR:")) {
it.activity?.showDialogFragment(TextDialog(kind.url))
} else {
callBack.openExplore(sourceUrl, kind.title, kind.url) callBack.openExplore(sourceUrl, kind.title, kind.url)
} }
} }
} }
} }
} }
}
@Synchronized @Synchronized
private fun getFlexboxChild(flexbox: FlexboxLayout): TextView { private fun getFlexboxChild(flexbox: FlexboxLayout): TextView {

Loading…
Cancel
Save