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