mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
This commit is contained in:
@@ -75,4 +75,11 @@ suspend fun BookSource.clearExploreKindsCache() {
|
||||
aCache.remove(exploreKindsKey)
|
||||
exploreKindsMap.remove(getExploreKindsKey())
|
||||
}
|
||||
}
|
||||
|
||||
fun BookSource.contains(word: String): Boolean {
|
||||
return bookSourceName.contains(word)
|
||||
|| bookSourceUrl.contains(word)
|
||||
|| bookSourceGroup?.contains(word) == true
|
||||
|| bookSourceComment?.contains(word) == true
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import io.legado.app.data.entities.BookSource
|
||||
import io.legado.app.databinding.DialogSearchScopeBinding
|
||||
import io.legado.app.databinding.ItemCheckBoxBinding
|
||||
import io.legado.app.databinding.ItemRadioButtonBinding
|
||||
import io.legado.app.help.source.contains
|
||||
import io.legado.app.lib.theme.primaryColor
|
||||
import io.legado.app.utils.applyTint
|
||||
import io.legado.app.utils.setLayout
|
||||
@@ -117,7 +118,7 @@ class SearchScopeDialog : BaseDialogFragment(R.layout.dialog_search_scope) {
|
||||
if (binding.rbSource.isChecked) {
|
||||
sources.filter { source ->
|
||||
screenText?.let { screenText ->
|
||||
source.bookSourceName.contains(screenText)
|
||||
source.contains(screenText)
|
||||
} ?: true
|
||||
}.let {
|
||||
screenSources.clear()
|
||||
|
||||
Reference in New Issue
Block a user