This commit is contained in:
ocean 2024-07-15 18:59:07 +08:00
parent e6ae24a88f
commit a39a64bb7c

View File

@ -200,6 +200,7 @@ class SearchFragment : MoBaseFragment<FragmentSearchBinding>(), TextWatcher,
LolAdWrapper.shared.showAdTiming( LolAdWrapper.shared.showAdTiming(
requireActivity(), AdPlacement.INST_SEARCH requireActivity(), AdPlacement.INST_SEARCH
) )
showLoadingLayout()
binding.contentLayout.removeAllViews() binding.contentLayout.removeAllViews()
binding.searchEdit.clearFocus() binding.searchEdit.clearFocus()
@ -272,12 +273,10 @@ class SearchFragment : MoBaseFragment<FragmentSearchBinding>(), TextWatcher,
override fun onHistoryItemClick(position: Int) { override fun onHistoryItemClick(position: Int) {
binding.searchEdit.setText(searchHistory[position]) binding.searchEdit.setText(searchHistory[position])
showLoadingLayout()
requests.trySend(Request.SearchData(searchHistory[position])) requests.trySend(Request.SearchData(searchHistory[position]))
} }
override fun onItemClick(position: Int) { override fun onItemClick(position: Int) {
showLoadingLayout()
binding.searchEdit.setText(searchSuggestionsList[position]) binding.searchEdit.setText(searchSuggestionsList[position])
val jsonObject = JSONObject() val jsonObject = JSONObject()
jsonObject.put("search_sug_string", searchSuggestionsList[position]) jsonObject.put("search_sug_string", searchSuggestionsList[position])
@ -290,7 +289,6 @@ class SearchFragment : MoBaseFragment<FragmentSearchBinding>(), TextWatcher,
override fun onEditorAction(v: TextView?, actionId: Int, event: KeyEvent?): Boolean { override fun onEditorAction(v: TextView?, actionId: Int, event: KeyEvent?): Boolean {
if (actionId == EditorInfo.IME_ACTION_SEARCH) { if (actionId == EditorInfo.IME_ACTION_SEARCH) {
showLoadingLayout()
requests.trySend(Request.SearchData(binding.searchEdit.text.toString().trim())) requests.trySend(Request.SearchData(binding.searchEdit.text.toString().trim()))
return true return true
} }