Commit 81b467e8 by 霍志良

feat:修改代码

parent 27a8bddb
...@@ -44,15 +44,20 @@ import kotlinx.android.synthetic.main.consultant_item_expert_hot_search.view.* ...@@ -44,15 +44,20 @@ import kotlinx.android.synthetic.main.consultant_item_expert_hot_search.view.*
@Route(path = "/consult/hot_search") @Route(path = "/consult/hot_search")
class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchContract.Presenter>(), class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchContract.Presenter>(),
IHotSearchContract.View { IHotSearchContract.View {
private lateinit var searchWordsAdapter: SearchWordsAdapter private lateinit var searchWordsAdapter: SearchWordsAdapter
private val searchSuggestList: ArrayList<SearchSuggestListBean> = ArrayList() private val searchSuggestList: ArrayList<SearchSuggestListBean> = ArrayList()
private var mSearchContent: String = "" private var mSearchContent: String = ""
private val CACHE_CONSULT_SEARCH_HISTORY_DATA = "cache_consult_search_history_data"
private val HOT_SEARCH_DOCTOR_NAME = "hot_search_doctor_name"
private val JUMP_WORD = "jump_word"
private var historyList: FixSizeLinkedList<String> = FixSizeLinkedList(15) private var historyList: FixSizeLinkedList<String> = FixSizeLinkedList(15)
private val bannerList = ArrayList<String>() private val bannerList = ArrayList<String>()
companion object {
private const val CACHE_CONSULT_SEARCH_HISTORY_DATA = "cache_consult_search_history_data"
private const val HOT_SEARCH_DOCTOR_NAME = "hot_search_doctor_name"
private const val JUMP_WORD = "jump_word"
}
//历史搜索内容的最大宽度 //历史搜索内容的最大宽度
private var maxWidth: Int = 0 private var maxWidth: Int = 0
...@@ -254,9 +259,9 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -254,9 +259,9 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
relatedWords = searchWordsBean.search_suggests[0].suggest_content relatedWords = searchWordsBean.search_suggests[0].suggest_content
} }
} }
if (!searchWordsBean.search_suggests.isNullOrEmpty() && searchWordsBean.search_suggests?.get( if (!searchWordsBean.search_suggests.isNullOrEmpty() && searchWordsBean.search_suggests.get(
0 0
)?.suggest_types?.contains(JUMP_WORD) ).suggest_types.contains(JUMP_WORD)
) { ) {
//将数据增加到历史搜索中 //将数据增加到历史搜索中
if (!TextUtils.isEmpty(searchContent)) { if (!TextUtils.isEmpty(searchContent)) {
...@@ -323,7 +328,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -323,7 +328,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
override fun searchHotWordData(wordList: MutableList<FunctionWordBean>) { override fun searchHotWordData(wordList: MutableList<FunctionWordBean>) {
//热门词搜索结果 //热门词搜索结果
if (null == wordList || wordList.isEmpty()) { if (wordList.isEmpty()) {
llHotSearch.visibility = View.GONE llHotSearch.visibility = View.GONE
return return
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment