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