优化
This commit is contained in:
@@ -76,3 +76,10 @@ suspend fun BookSource.clearExploreKindsCache() {
|
|||||||
exploreKindsMap.remove(getExploreKindsKey())
|
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.DialogSearchScopeBinding
|
||||||
import io.legado.app.databinding.ItemCheckBoxBinding
|
import io.legado.app.databinding.ItemCheckBoxBinding
|
||||||
import io.legado.app.databinding.ItemRadioButtonBinding
|
import io.legado.app.databinding.ItemRadioButtonBinding
|
||||||
|
import io.legado.app.help.source.contains
|
||||||
import io.legado.app.lib.theme.primaryColor
|
import io.legado.app.lib.theme.primaryColor
|
||||||
import io.legado.app.utils.applyTint
|
import io.legado.app.utils.applyTint
|
||||||
import io.legado.app.utils.setLayout
|
import io.legado.app.utils.setLayout
|
||||||
@@ -117,7 +118,7 @@ class SearchScopeDialog : BaseDialogFragment(R.layout.dialog_search_scope) {
|
|||||||
if (binding.rbSource.isChecked) {
|
if (binding.rbSource.isChecked) {
|
||||||
sources.filter { source ->
|
sources.filter { source ->
|
||||||
screenText?.let { screenText ->
|
screenText?.let { screenText ->
|
||||||
source.bookSourceName.contains(screenText)
|
source.contains(screenText)
|
||||||
} ?: true
|
} ?: true
|
||||||
}.let {
|
}.let {
|
||||||
screenSources.clear()
|
screenSources.clear()
|
||||||
|
|||||||
Reference in New Issue
Block a user