mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
优化
This commit is contained in:
parent
6256e78f5f
commit
aa74875c15
@ -39,6 +39,7 @@ import splitties.init.appCtx
|
|||||||
class SearchActivity : VMBaseActivity<ActivityBookSearchBinding, SearchViewModel>(),
|
class SearchActivity : VMBaseActivity<ActivityBookSearchBinding, SearchViewModel>(),
|
||||||
BookAdapter.CallBack,
|
BookAdapter.CallBack,
|
||||||
HistoryKeyAdapter.CallBack,
|
HistoryKeyAdapter.CallBack,
|
||||||
|
SearchScopeDialog.Callback,
|
||||||
SearchAdapter.CallBack {
|
SearchAdapter.CallBack {
|
||||||
|
|
||||||
override val binding by viewBinding(ActivityBookSearchBinding::inflate)
|
override val binding by viewBinding(ActivityBookSearchBinding::inflate)
|
||||||
@ -402,10 +403,18 @@ class SearchActivity : VMBaseActivity<ActivityBookSearchBinding, SearchViewModel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除搜索记录
|
||||||
|
*/
|
||||||
override fun deleteHistory(searchKeyword: SearchKeyword) {
|
override fun deleteHistory(searchKeyword: SearchKeyword) {
|
||||||
viewModel.deleteHistory(searchKeyword)
|
viewModel.deleteHistory(searchKeyword)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
override fun onSearchScopeOk() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private fun alertSearchScope() {
|
private fun alertSearchScope() {
|
||||||
showDialogFragment<SearchScopeDialog>()
|
showDialogFragment<SearchScopeDialog>()
|
||||||
}
|
}
|
||||||
|
@ -7,10 +7,24 @@ import io.legado.app.base.BaseDialogFragment
|
|||||||
|
|
||||||
class SearchScopeDialog : BaseDialogFragment(R.layout.dialog_search_scope, true) {
|
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?) {
|
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
TODO("Not yet implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
interface Callback {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 搜索范围确认
|
||||||
|
*/
|
||||||
|
fun onSearchScopeOk()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user