pull/2424/head
kunfei 2 years ago
parent 6715796f09
commit e5c2b9e180
  1. 8
      app/src/main/java/io/legado/app/ui/book/search/SearchScopeDialog.kt

@ -24,8 +24,8 @@ class SearchScopeDialog : BaseDialogFragment(R.layout.dialog_search_scope) {
private val binding by viewBinding(DialogSearchScopeBinding::bind) private val binding by viewBinding(DialogSearchScopeBinding::bind)
val callback: Callback get() = parentFragment as? Callback ?: activity as Callback val callback: Callback get() = parentFragment as? Callback ?: activity as Callback
var groups: List<String> = arrayListOf() var groups = arrayListOf<String>()
var sources: List<BookSource> = arrayListOf() var sources = arrayListOf<BookSource>()
val adapter by lazy { val adapter by lazy {
RecyclerAdapter() RecyclerAdapter()
@ -74,8 +74,8 @@ class SearchScopeDialog : BaseDialogFragment(R.layout.dialog_search_scope) {
private fun initData() { private fun initData() {
launch { launch {
withContext(IO) { withContext(IO) {
groups = appDb.bookSourceDao.allGroups groups.addAll(appDb.bookSourceDao.allGroups)
sources = appDb.bookSourceDao.allEnabled sources.addAll(appDb.bookSourceDao.allEnabled)
} }
upData() upData()
} }

Loading…
Cancel
Save