mirror of
https://github.com/gedoor/legado.git
synced 2024-07-04 23:36:56 +08:00
commit
c8a88000b4
|
@ -16,6 +16,9 @@ object AppPattern {
|
|||
val fileNameRegex = Regex("[\\\\/:*?\"<>|.]")
|
||||
val splitGroupRegex = Regex("[,;,;]")
|
||||
|
||||
//书源调试信息中的各种符号
|
||||
val debugMessageSymbolRegex = Regex("[⇒◇┌└≡]")
|
||||
|
||||
/**
|
||||
* 所有标点
|
||||
*/
|
||||
|
|
|
@ -47,7 +47,7 @@ object CheckSource {
|
|||
}
|
||||
|
||||
fun putConfig() {
|
||||
CacheManager.put("checkSourceTimeout", timeout * 1000)
|
||||
CacheManager.put("checkSourceTimeout", timeout)
|
||||
CacheManager.put("checkSearch", checkSearch)
|
||||
CacheManager.put("checkDiscovery", checkDiscovery)
|
||||
CacheManager.put("checkInfo", checkInfo)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package io.legado.app.model
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import io.legado.app.constant.AppPattern
|
||||
import io.legado.app.data.entities.*
|
||||
import io.legado.app.help.coroutine.CompositeCoroutine
|
||||
import io.legado.app.model.rss.Rss
|
||||
|
@ -56,7 +57,7 @@ object Debug {
|
|||
if (showTime && debugTimeMap[sourceUrl] != null) {
|
||||
val time =
|
||||
debugTimeFormat.format(Date(System.currentTimeMillis() - debugTimeMap[sourceUrl]!!))
|
||||
printMsg = printMsg.substring(1)
|
||||
printMsg = printMsg.replace(AppPattern.debugMessageSymbolRegex,"")
|
||||
debugMessageMap[sourceUrl] = "$time $printMsg"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,36 @@ class CheckSourceConfig : BaseDialogFragment(R.layout.dialog_check_source_config
|
|||
|
||||
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
||||
binding.toolBar.setBackgroundColor(primaryColor)
|
||||
binding.run {
|
||||
checkSearch.onClick {
|
||||
if (!checkSearch.isChecked && !checkDiscovery.isChecked) {
|
||||
checkDiscovery.isChecked = true
|
||||
}
|
||||
}
|
||||
checkDiscovery.onClick {
|
||||
if (!checkSearch.isChecked && !checkDiscovery.isChecked) {
|
||||
checkSearch.isChecked = true
|
||||
}
|
||||
}
|
||||
checkInfo.onClick {
|
||||
if (!checkInfo.isChecked) {
|
||||
checkCategory.isChecked = false
|
||||
checkContent.isChecked = false
|
||||
checkCategory.isEnabled = false
|
||||
checkContent.isEnabled = false
|
||||
} else {
|
||||
checkCategory.isEnabled = true
|
||||
}
|
||||
}
|
||||
checkCategory.onClick {
|
||||
if (!checkCategory.isChecked) {
|
||||
checkContent.isChecked = false
|
||||
checkContent.isEnabled = false
|
||||
} else {
|
||||
checkContent.isEnabled = true
|
||||
}
|
||||
}
|
||||
}
|
||||
CheckSource.run {
|
||||
binding.checkSourceTimeout.setText((timeout / 1000).toString())
|
||||
binding.checkSearch.isChecked = checkSearch
|
||||
|
@ -38,6 +68,8 @@ class CheckSourceConfig : BaseDialogFragment(R.layout.dialog_check_source_config
|
|||
binding.checkInfo.isChecked = checkInfo
|
||||
binding.checkCategory.isChecked = checkCategory
|
||||
binding.checkContent.isChecked = checkContent
|
||||
binding.checkCategory.isEnabled = checkInfo
|
||||
binding.checkContent.isEnabled = checkCategory
|
||||
binding.tvCancel.onClick {
|
||||
dismiss()
|
||||
}
|
||||
|
@ -60,14 +92,8 @@ class CheckSourceConfig : BaseDialogFragment(R.layout.dialog_check_source_config
|
|||
}
|
||||
else -> timeout = text.toLong() * 1000
|
||||
}
|
||||
val mCheckSearch = binding.checkSearch.isChecked
|
||||
val mCheckDiscovery = binding.checkDiscovery.isChecked
|
||||
if (!mCheckSearch && !mCheckDiscovery) {
|
||||
toastOnUi(getString(R.string.error_check_source_config))
|
||||
return@onClick
|
||||
}
|
||||
checkSearch = mCheckSearch
|
||||
checkDiscovery = mCheckDiscovery
|
||||
checkSearch = binding.checkSearch.isChecked
|
||||
checkDiscovery = binding.checkDiscovery.isChecked
|
||||
checkInfo = binding.checkInfo.isChecked
|
||||
checkCategory = binding.checkCategory.isChecked
|
||||
checkContent = binding.checkContent.isChecked
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
<io.legado.app.ui.widget.text.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="12dp"
|
||||
android:paddingRight="12dp"
|
||||
android:paddingTop="3dp">
|
||||
|
||||
<io.legado.app.lib.theme.view.ThemeEditText
|
||||
|
@ -30,15 +32,15 @@
|
|||
</io.legado.app.ui.widget.text.TextInputLayout>
|
||||
|
||||
<io.legado.app.ui.widget.text.AccentTextView
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingLeft="12dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/check_source_item" />
|
||||
|
||||
<com.google.android.flexbox.FlexboxLayout
|
||||
android:layout_width="match_parent"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingLeft="12dp"
|
||||
android:paddingRight="12dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:flexWrap="wrap"
|
||||
app:justifyContent="space_between">
|
||||
|
@ -74,8 +76,8 @@
|
|||
<com.google.android.flexbox.FlexboxLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="12dp"
|
||||
android:paddingRight="12dp"
|
||||
app:flexWrap="wrap"
|
||||
app:justifyContent="flex_end">
|
||||
|
||||
<io.legado.app.ui.widget.text.AccentTextView
|
||||
|
|
|
@ -928,7 +928,6 @@
|
|||
<string name="timeout">超时</string>
|
||||
<string name="seconds">秒</string>
|
||||
<string name="less_than">小于</string>
|
||||
<string name="error_check_source_config">搜索发现至少校验一个</string>
|
||||
<string name="check_source_config_summary">校验超时: %1$s秒\n校验项目:%2$s</string>
|
||||
<!-- string end -->
|
||||
</resources>
|
||||
|
|
Loading…
Reference in New Issue
Block a user