Commit dbab9091 by 霍志良

feat:修改底纹词

parent cbabfffb
ext { ext {
dev_mode = false //组件发布的时候需要设置为false dev_mode = true //组件发布的时候需要设置为false
ydl2PublishVersion = "0.2.0.14-SNAPSHOT" ydl2PublishVersion = "0.2.0.14-SNAPSHOT"
ydlPublishVersion = [ ydlPublishVersion = [
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
......
...@@ -73,7 +73,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -73,7 +73,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
SwipeRefreshLayout.OnRefreshListener { SwipeRefreshLayout.OnRefreshListener {
var bottomWordDisposable: Disposable? = null var bottomWordDisposable: Disposable? = null
private lateinit var bottomWordlist: List<FunctionWordBean> private lateinit var bottomWordlist: List<FunctionWordBean>
private var searchWord: String? = ""
override fun showImage(url: String?, imgView: ImageView) { override fun showImage(url: String?, imgView: ImageView) {
YDLImageCacheManager.showImage(ExpertSearchActivity@ this, url, imgView) YDLImageCacheManager.showImage(ExpertSearchActivity@ this, url, imgView)
} }
...@@ -391,7 +391,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -391,7 +391,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
initCategory = mIntent.getStringExtra(EXTRA_CATEGORY) ?: "" initCategory = mIntent.getStringExtra(EXTRA_CATEGORY) ?: ""
initShowType = mIntent.getIntExtra(EXTRA_SHOW_TYPE, 0) initShowType = mIntent.getIntExtra(EXTRA_SHOW_TYPE, 0)
val relatedWord = mIntent.getStringExtra(EXTRA_RELATED_WORD) // 搜索内容的联想词 val relatedWord = mIntent.getStringExtra(EXTRA_RELATED_WORD) // 搜索内容的联想词
val searchWord = mIntent.getStringExtra(EXTRA_SEARCH_WORD) searchWord = mIntent.getStringExtra(EXTRA_SEARCH_WORD)
val isRecommendWords = mIntent.getBooleanExtra(EXTRA_IS_RECCOMMEND_WORD, false) val isRecommendWords = mIntent.getBooleanExtra(EXTRA_IS_RECCOMMEND_WORD, false)
if (!TextUtils.isEmpty(relatedWord)) { // 判断搜索内容的联想词为空,则用搜索词进行搜索 if (!TextUtils.isEmpty(relatedWord)) { // 判断搜索内容的联想词为空,则用搜索词进行搜索
allFilter.searchWord = relatedWord allFilter.searchWord = relatedWord
...@@ -422,11 +422,11 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -422,11 +422,11 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
LogUtil.e("relatedWord:${relatedWord}") LogUtil.e("relatedWord:${relatedWord}")
if (!TextUtils.isEmpty(searchWord) && !TextUtils.isEmpty(relatedWord) && searchWord != relatedWord) { if (!TextUtils.isEmpty(searchWord) && !TextUtils.isEmpty(relatedWord) && searchWord != relatedWord) {
if (doctorList.size > 0 && doctorList[0].is_head_view) { if (doctorList.size > 0 && doctorList[0].is_head_view) {
doctorList[0] = ExpertServiceItem(true, searchWord, relatedWord) doctorList[0] = ExpertServiceItem(true, searchWord.toString(), relatedWord)
} else if (doctorList.size > 0) { } else if (doctorList.size > 0) {
doctorList.add(0, ExpertServiceItem(true, searchWord, relatedWord)) doctorList.add(0, ExpertServiceItem(true, searchWord.toString(), relatedWord))
} else { } else {
doctorList.add(ExpertServiceItem(true, searchWord, relatedWord)) doctorList.add(ExpertServiceItem(true, searchWord.toString(), relatedWord))
} }
} else { } else {
if (doctorList.size > 0 && doctorList[0].is_head_view) { if (doctorList.size > 0 && doctorList[0].is_head_view) {
...@@ -524,18 +524,23 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -524,18 +524,23 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
//获取底纹词 //获取底纹词
bottomWordlist = wordBean!! bottomWordlist = wordBean!!
if (bottomWordlist.isNullOrEmpty()) return if (bottomWordlist.isNullOrEmpty()) return
if (bottomWordlist.size == 1) { if (!searchWord.isNullOrEmpty()) {
tv_search_content.text = bottomWordlist[0].word tv_search_content.text = searchWord
} else { } else {
bottomWordDisposable = Observable.interval(0, 3, TimeUnit.SECONDS) if (bottomWordlist.size == 1) {
.subscribeOn(Schedulers.computation()) tv_search_content.text = bottomWordlist[0].word
.observeOn(AndroidSchedulers.mainThread()) } else {
.subscribe({ bottomWordDisposable = Observable.interval(0, 3, TimeUnit.SECONDS)
tv_search_content.text = bottomWordlist[(it % bottomWordlist.size).toInt()].word .subscribeOn(Schedulers.computation())
}, { .observeOn(AndroidSchedulers.mainThread())
}, { .subscribe({
tv_search_content.text =
bottomWordlist[(it % bottomWordlist.size).toInt()].word
}, {
}, {
}) })
}
} }
} }
......
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