Commit faaeec78 by fengquan

feat: Code Review代码调整

parent b9b56cc8
......@@ -126,7 +126,7 @@ class ConfideHomeActivity :
private var bottomSheetDialogFragment: ConfideBottomSheetDialogFragment? = null
private var keyword : String = "";
private var keyword: String = "";
init {
//初始化参数
......@@ -253,7 +253,7 @@ class ConfideHomeActivity :
}
private fun showDoctorDetail(confideId: String, doctorId: String) {
val url = HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro(confideId)+"&payPage=1"
val url = HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro(confideId) + "&payPage=1"
ConfideBottomSheetDialogFragment()
.showBottomSheetDialog(this@ConfideHomeActivity, url, doctorId)
}
......@@ -352,10 +352,10 @@ class ConfideHomeActivity :
rl_search_head.setOnClickListener {
var intent = Intent(this, ConfideSearchActivity::class.java)
if (!TextUtils.isEmpty(keyword)){
intent.putExtra(FinalString.CONFIDE_SEARCH_KEY_WORD,keyword)
if (!TextUtils.isEmpty(keyword)) {
intent.putExtra(FinalString.CONFIDE_SEARCH_KEY_WORD, keyword)
}
startActivityForResult(intent,SEARCH_REQUEST_CODE)
startActivityForResult(intent, SEARCH_REQUEST_CODE)
}
}
......@@ -427,7 +427,10 @@ class ConfideHomeActivity :
initParam()
hideError()
cacheList?.addAll(0, list)
cacheList?.add(0, ConfideHomeDataBean(IConfideHomeConfig.TYPE_SEARCH,null,null,null, -1,keyword))
cacheList?.add(
0,
ConfideHomeDataBean(IConfideHomeConfig.TYPE_SEARCH, null, null, null, -1, keyword)
)
updateAdapter()
setSuspendListener()
v_filterView.refreshView()
......@@ -437,7 +440,7 @@ class ConfideHomeActivity :
* 设置筛选模块悬浮顶部监听数据
*/
private fun setSuspendListener() {
listSuspendListener?.setFilterView(v_filterView,rl_search_head, vFilterLine)
listSuspendListener?.setFilterView(v_filterView, rl_search_head, vFilterLine)
listSuspendListener?.setSectionAdapter(mConfideAdapter!!)
}
......@@ -450,8 +453,8 @@ class ConfideHomeActivity :
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == SEARCH_REQUEST_CODE && resultCode == RESULT_OK) {
val keyWord = data?.getStringExtra(FinalString.CONFIDE_SEARCH_KEY_WORD)
if (keyWord != null){
keyword = keyWord
if (keyWord != null) {
this.keyword = keyWord
page = 1
allFiltersBean = ConfideHomeAllFiltersBean(
page,
......@@ -541,17 +544,25 @@ class ConfideHomeActivity :
}
if (bean?.body != null && bean?.body.size == 0) {
var hasEmptyLayout : Boolean = false
var hasEmptyLayout: Boolean = false
for (index in (0..(cacheList!!.size - 1)).reversed()) {
if (cacheList!![index].type == IConfideHomeConfig.TYPE_EMPTY) {
hasEmptyLayout = true
break
}
}
if (!hasEmptyLayout){
cacheList?.add(ConfideHomeDataBean(IConfideHomeConfig.TYPE_EMPTY,null,null,null, -1))
if (!hasEmptyLayout) {
cacheList?.add(
ConfideHomeDataBean(
IConfideHomeConfig.TYPE_EMPTY,
null,
null,
null,
-1
)
)
}
}else{
} else {
for (index in (0..(cacheList!!.size - 1)).reversed()) {
if (cacheList!![index].type == IConfideHomeConfig.TYPE_EMPTY) {
cacheList!!.removeAt(index)
......
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