pull/2412/head
kunfei 2 years ago
parent 6256e78f5f
commit aa74875c15
  1. 9
      app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt
  2. 16
      app/src/main/java/io/legado/app/ui/book/search/SearchScopeDialog.kt

@ -39,6 +39,7 @@ import splitties.init.appCtx
class SearchActivity : VMBaseActivity<ActivityBookSearchBinding, SearchViewModel>(),
BookAdapter.CallBack,
HistoryKeyAdapter.CallBack,
SearchScopeDialog.Callback,
SearchAdapter.CallBack {
override val binding by viewBinding(ActivityBookSearchBinding::inflate)
@ -402,10 +403,18 @@ class SearchActivity : VMBaseActivity<ActivityBookSearchBinding, SearchViewModel
}
}
/**
* 删除搜索记录
*/
override fun deleteHistory(searchKeyword: SearchKeyword) {
viewModel.deleteHistory(searchKeyword)
}
override fun onSearchScopeOk() {
}
private fun alertSearchScope() {
showDialogFragment<SearchScopeDialog>()
}

@ -7,10 +7,24 @@ import io.legado.app.base.BaseDialogFragment
class SearchScopeDialog : BaseDialogFragment(R.layout.dialog_search_scope, true) {
val callback: Callback
get() {
return parentFragment as? Callback ?: activity as Callback
}
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
TODO("Not yet implemented")
}
interface Callback {
/**
* 搜索范围确认
*/
fun onSearchScopeOk()
}
}
Loading…
Cancel
Save