mirror of
https://github.com/gedoor/legado.git
synced 2024-09-03 09:55:00 +08:00
优化
This commit is contained in:
parent
3b640ff0cb
commit
651d501ff4
@ -36,12 +36,8 @@ object RuleComplete {
|
||||
fun autoComplete(
|
||||
rule: String?,
|
||||
preRule: String? = null,
|
||||
type: Int = 1,
|
||||
enable: Boolean
|
||||
type: Int = 1
|
||||
): String? {
|
||||
if (!enable) {
|
||||
return rule
|
||||
}
|
||||
if (rule.isNullOrEmpty() || rule.contains(completeIgnore)
|
||||
|| preRule?.contains(completeIgnorePreRule) == true
|
||||
) {
|
||||
|
@ -98,7 +98,10 @@ class BookSourceEditViewModel(application: Application) : BaseViewModel(applicat
|
||||
}
|
||||
|
||||
fun ruleComplete(rule: String?, preRule: String? = null, type: Int = 1): String? {
|
||||
return RuleComplete.autoComplete(rule, preRule, type, autoComplete)
|
||||
if (autoComplete) {
|
||||
return RuleComplete.autoComplete(rule, preRule, type)
|
||||
}
|
||||
return rule
|
||||
}
|
||||
|
||||
}
|
@ -78,7 +78,10 @@ class RssSourceEditViewModel(application: Application) : BaseViewModel(applicati
|
||||
}
|
||||
|
||||
fun ruleComplete(rule: String?, preRule: String? = null, type: Int = 1): String? {
|
||||
return RuleComplete.autoComplete(rule, preRule, type, autoComplete)
|
||||
if (autoComplete) {
|
||||
return RuleComplete.autoComplete(rule, preRule, type)
|
||||
}
|
||||
return rule
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user