搜索添加搜索范围可选择单个书源和分组,未完成

This commit is contained in:
kunfei 2022-10-10 23:31:27 +08:00
parent bd2cc750c0
commit 691071d4de
9 changed files with 23 additions and 1 deletions

View File

@ -224,7 +224,8 @@ class SearchActivity : VMBaseActivity<ActivityBookSearchBinding, SearchViewModel
viewModel.stop()
binding.refreshProgressBar.isAutoLoading = false
}
binding.tvClearHistory.setOnClickListener { viewModel.clearHistory() }
binding.tvToggleSearchScope.setOnClickListener { alertSearchScope() }
binding.tvClearHistory.setOnClickListener { alertClearHistory() }
}
private fun initData() {
@ -405,6 +406,19 @@ class SearchActivity : VMBaseActivity<ActivityBookSearchBinding, SearchViewModel
viewModel.deleteHistory(searchKeyword)
}
private fun alertSearchScope() {
}
private fun alertClearHistory() {
alert(R.string.draw) {
setMessage(R.string.sure_clear_search_history)
yesButton {
viewModel.clearHistory()
}
noButton()
}
}
companion object {

View File

@ -60,6 +60,7 @@
android:text="@string/search_scope" />
<TextView
android:id="@+id/tv_toggle_search_scope"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="6dp"

View File

@ -1042,4 +1042,5 @@
<string name="restore_last_book_process">是否恢复到跳转前的阅读进度?</string>
<string name="search_scope">搜索范围</string>
<string name="toggle_search_scope">切换</string>
<string name="sure_clear_search_history">是否确认清除所有搜索历史记录</string>
</resources>

View File

@ -1045,4 +1045,5 @@
<string name="restore_last_book_process">是否恢复到跳转前的阅读进度?</string>
<string name="search_scope">搜索范围</string>
<string name="toggle_search_scope">切换</string>
<string name="sure_clear_search_history">是否确认清除所有搜索历史记录</string>
</resources>

View File

@ -1045,4 +1045,5 @@
<string name="restore_last_book_process">是否恢复到跳转前的阅读进度?</string>
<string name="search_scope">搜索范围</string>
<string name="toggle_search_scope">切换</string>
<string name="sure_clear_search_history">是否确认清除所有搜索历史记录</string>
</resources>

View File

@ -1042,4 +1042,5 @@
<string name="restore_last_book_process">是否恢复到跳转前的阅读进度?</string>
<string name="search_scope">搜索范围</string>
<string name="toggle_search_scope">切换</string>
<string name="sure_clear_search_history">是否确认清除所有搜索历史记录</string>
</resources>

View File

@ -1044,4 +1044,5 @@
<string name="restore_last_book_process">是否恢复到跳转前的阅读进度?</string>
<string name="search_scope">搜索范围</string>
<string name="toggle_search_scope">切换</string>
<string name="sure_clear_search_history">是否确认清除所有搜索历史记录</string>
</resources>

View File

@ -1044,4 +1044,5 @@
<string name="restore_last_book_process">是否恢复到跳转前的阅读进度?</string>
<string name="search_scope">搜索范围</string>
<string name="toggle_search_scope">切换</string>
<string name="sure_clear_search_history">是否确认清除所有搜索历史记录</string>
</resources>

View File

@ -1045,4 +1045,5 @@
<string name="restore_last_book_process">是否恢复到跳转前的阅读进度?</string>
<string name="search_scope">搜索范围</string>
<string name="toggle_search_scope">切换</string>
<string name="sure_clear_search_history">是否确认清除所有搜索历史记录</string>
</resources>