pull/2468/head
kunfei 2 years ago
parent 6bdcd057c5
commit 4f741dff90
  1. 10
      app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt

@ -117,8 +117,8 @@ class SearchActivity : VMBaseActivity<ActivityBookSearchBinding, SearchViewModel
menu.removeGroup(R.id.menu_group_1)
menu.removeGroup(R.id.menu_group_2)
val searchScopeNames = viewModel.searchScope.displayNames
searchScopeNames.forEach {
menu.add(R.id.menu_group_1, Menu.NONE, Menu.NONE, it).apply {
if (viewModel.searchScope.isSource()) {
menu.add(R.id.menu_group_1, Menu.NONE, Menu.NONE, searchScopeNames.first()).apply {
isChecked = true
}
}
@ -128,7 +128,11 @@ class SearchActivity : VMBaseActivity<ActivityBookSearchBinding, SearchViewModel
}
}
groups?.forEach {
if (!searchScopeNames.contains(it)) {
if (searchScopeNames.contains(it)) {
menu.add(R.id.menu_group_1, Menu.NONE, Menu.NONE, it).apply {
isChecked = true
}
} else {
menu.add(R.id.menu_group_2, Menu.NONE, Menu.NONE, it)
}
}

Loading…
Cancel
Save