mirror of
https://github.com/gedoor/legado.git
synced 2024-07-06 23:47:49 +08:00
commit
e3f478c686
@ -15,6 +15,7 @@
|
||||
|
||||
* 修复web写源订阅源保存失败bug
|
||||
* http朗读下载错误连续5次后自动暂停
|
||||
* 添加其他设置-校验设置
|
||||
* 其它一些优化
|
||||
|
||||
**2022/01/20**
|
||||
|
@ -8,6 +8,7 @@ import io.legado.app.service.CheckSourceService
|
||||
import io.legado.app.utils.startService
|
||||
import io.legado.app.utils.toastOnUi
|
||||
import io.legado.app.help.CacheManager
|
||||
import splitties.init.appCtx
|
||||
|
||||
object CheckSource {
|
||||
var keyword = "我的"
|
||||
@ -18,6 +19,11 @@ object CheckSource {
|
||||
var checkInfo = CacheManager.get("checkInfo")?.toBoolean() ?: true
|
||||
var checkCategory = CacheManager.get("checkCategory")?.toBoolean() ?: true
|
||||
var checkContent = CacheManager.get("checkContent")?.toBoolean() ?: true
|
||||
var summary = ""
|
||||
|
||||
init {
|
||||
upSummary()
|
||||
}
|
||||
|
||||
fun start(context: Context, sources: List<BookSource>) {
|
||||
if (sources.isEmpty()) {
|
||||
@ -47,5 +53,16 @@ object CheckSource {
|
||||
CacheManager.put("checkInfo", checkInfo)
|
||||
CacheManager.put("checkCategory", checkCategory)
|
||||
CacheManager.put("checkContent", checkContent)
|
||||
upSummary()
|
||||
}
|
||||
|
||||
fun upSummary() {
|
||||
summary = ""
|
||||
if (checkSearch) summary = "${summary} ${appCtx.getString(R.string.search)}"
|
||||
if (checkDiscovery) summary = "${summary} ${appCtx.getString(R.string.discovery)}"
|
||||
if (checkInfo) summary = "${summary} ${appCtx.getString(R.string.source_tab_info)}"
|
||||
if (checkCategory) summary = "${summary} ${appCtx.getString(R.string.chapter_list)}"
|
||||
if (checkContent) summary = "${summary} ${appCtx.getString(R.string.main_body)}"
|
||||
summary = appCtx.getString(R.string.check_source_config_summary, (timeout / 1000).toString(), summary)
|
||||
}
|
||||
}
|
@ -12,6 +12,8 @@ import io.legado.app.utils.setLayout
|
||||
import io.legado.app.utils.toastOnUi
|
||||
import io.legado.app.utils.viewbindingdelegate.viewBinding
|
||||
import splitties.views.onClick
|
||||
import io.legado.app.constant.PreferKey
|
||||
import io.legado.app.utils.putPrefString
|
||||
|
||||
class CheckSourceConfig : BaseDialogFragment(R.layout.dialog_check_source_config) {
|
||||
|
||||
@ -70,6 +72,7 @@ class CheckSourceConfig : BaseDialogFragment(R.layout.dialog_check_source_config
|
||||
checkCategory = binding.checkCategory.isChecked
|
||||
checkContent = binding.checkContent.isChecked
|
||||
putConfig()
|
||||
putPrefString(PreferKey.checkSource, summary)
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ import io.legado.app.R
|
||||
import io.legado.app.base.BasePreferenceFragment
|
||||
import io.legado.app.constant.EventBus
|
||||
import io.legado.app.constant.PreferKey
|
||||
import io.legado.app.model.CheckSource
|
||||
import io.legado.app.databinding.DialogEditTextBinding
|
||||
import io.legado.app.help.AppConfig
|
||||
import io.legado.app.help.BookHelp
|
||||
@ -52,6 +53,7 @@ class OtherConfigFragment : BasePreferenceFragment(),
|
||||
AppConfig.defaultBookTreeUri?.let {
|
||||
upPreferenceSummary(PreferKey.defaultBookTreeUri, it)
|
||||
}
|
||||
upPreferenceSummary(PreferKey.checkSource, CheckSource.summary)
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
@ -134,6 +136,9 @@ class OtherConfigFragment : BasePreferenceFragment(),
|
||||
PreferKey.userAgent -> listView.post {
|
||||
upPreferenceSummary(PreferKey.userAgent, AppConfig.userAgent)
|
||||
}
|
||||
PreferKey.checkSource -> listView.post {
|
||||
upPreferenceSummary(PreferKey.checkSource, CheckSource.summary)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -929,5 +929,6 @@
|
||||
<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