pull/1732/head
kunfei 3 years ago
parent 29f8f6be20
commit 561f1e4e6b
  1. 29
      app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt

@ -64,19 +64,12 @@ class SearchActivity : VMBaseActivity<ActivityBookSearchBinding, SearchViewModel
private var menu: Menu? = null
private var precisionSearchMenuItem: MenuItem? = null
private var groups = linkedSetOf<String>()
override fun onActivityCreated(savedInstanceState: Bundle?) {
binding.llHistory.setBackgroundColor(backgroundColor)
initRecyclerView()
initSearchView()
initOtherView()
initData()
receiptIntent(intent)
viewModel.searchFinishCallback = {
if (it) {
val searchGroup = getPrefString("searchGroup")
if (!searchGroup.isNullOrEmpty()) {
alert(R.string.empty) {
private val searchFinishCallback: (isEmpty: Boolean) -> Unit = {
if (it) {
val searchGroup = getPrefString("searchGroup")
if (!searchGroup.isNullOrEmpty()) {
launch {
alert("搜索结果为空") {
setMessage("${searchGroup}分组搜索结果为空,是否切换到全部分组")
cancelButton()
okButton {
@ -90,6 +83,16 @@ class SearchActivity : VMBaseActivity<ActivityBookSearchBinding, SearchViewModel
}
}
override fun onActivityCreated(savedInstanceState: Bundle?) {
binding.llHistory.setBackgroundColor(backgroundColor)
initRecyclerView()
initSearchView()
initOtherView()
initData()
receiptIntent(intent)
viewModel.searchFinishCallback = searchFinishCallback
}
override fun onNewIntent(data: Intent?) {
super.onNewIntent(data)
receiptIntent(data)

Loading…
Cancel
Save