Commit b1d11aed by 霍志良

feat:首页数据修改

parent b4e9ad37
...@@ -9,7 +9,7 @@ ext { ...@@ -9,7 +9,7 @@ ext {
"m-consultant" : "0.0.60.11", "m-consultant" : "0.0.60.11",
"m-fm" : "0.0.30.04", "m-fm" : "0.0.30.04",
"m-user" : "0.0.62.01", "m-user" : "0.0.62.01",
"m-home" : "0.0.23.10", "m-home" : "0.0.23.13",
"m-im" : "0.0.21.18", "m-im" : "0.0.21.18",
"m-dynamic" : "0.0.7.35", "m-dynamic" : "0.0.7.35",
"m-article" : "0.0.0.10", "m-article" : "0.0.0.10",
......
...@@ -72,10 +72,7 @@ class YdlHomeAdapter(private val mContext: Context, ...@@ -72,10 +72,7 @@ class YdlHomeAdapter(private val mContext: Context,
//重置标记位 //重置标记位
confidePosition = -1 confidePosition = -1
consultPosition = -1 consultPosition = -1
updateConfideFreeData(null)
notifyDataSetChanged() notifyDataSetChanged()
LogUtil.e("aaaaaaaaupdateItems"+listenFree)
} }
/** /**
...@@ -88,8 +85,6 @@ class YdlHomeAdapter(private val mContext: Context, ...@@ -88,8 +85,6 @@ class YdlHomeAdapter(private val mContext: Context,
list[confidePosition].confideBean = data list[confidePosition].confideBean = data
this.confideSelectPosition = selectPosition this.confideSelectPosition = selectPosition
notifyItemChanged(confidePosition) notifyItemChanged(confidePosition)
LogUtil.e("aaaaaaaaupdateConfideData"+listenFree)
} }
/** /**
* 更新倾诉免费标识 * 更新倾诉免费标识
...@@ -99,10 +94,7 @@ class YdlHomeAdapter(private val mContext: Context, ...@@ -99,10 +94,7 @@ class YdlHomeAdapter(private val mContext: Context,
if (data!=null){ if (data!=null){
list[1].headerBean = data list[1].headerBean = data
} }
notifyItemChanged(1) notifyItemChanged(1)
LogUtil.e("aaaaaaaaupdateupdateConfideFreeData"+listenFree)
} }
/** /**
...@@ -115,9 +107,6 @@ class YdlHomeAdapter(private val mContext: Context, ...@@ -115,9 +107,6 @@ class YdlHomeAdapter(private val mContext: Context,
list[consultPosition].consultBean = data list[consultPosition].consultBean = data
this.consultSelectPosition = selectPosition this.consultSelectPosition = selectPosition
notifyItemChanged(consultPosition) notifyItemChanged(consultPosition)
LogUtil.e("aaaaaaaaupdateConsultData"+listenFree)
notifyItemChanged(1)
} }
/** /**
...@@ -126,7 +115,6 @@ class YdlHomeAdapter(private val mContext: Context, ...@@ -126,7 +115,6 @@ class YdlHomeAdapter(private val mContext: Context,
fun updateAskData(data: HomeAskBean, position: Int) { fun updateAskData(data: HomeAskBean, position: Int) {
list[position].askBean = data list[position].askBean = data
// notifyItemChanged(position) // notifyItemChanged(position)
LogUtil.e("aaaaaaaupdateAskData"+listenFree)
} }
...@@ -140,7 +128,6 @@ class YdlHomeAdapter(private val mContext: Context, ...@@ -140,7 +128,6 @@ class YdlHomeAdapter(private val mContext: Context,
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
LogUtil.e("aaaaaaaaaa"+viewType+listenFree)
when (viewType) { when (viewType) {
//顶部ViewPager与分类模块 //顶部ViewPager与分类模块
HomeViewConfig.getOrder().bannerIndex -> { HomeViewConfig.getOrder().bannerIndex -> {
...@@ -216,6 +203,7 @@ class YdlHomeAdapter(private val mContext: Context, ...@@ -216,6 +203,7 @@ class YdlHomeAdapter(private val mContext: Context,
} }
//顶部预约专家,即时倾诉,心理课堂,心理测试按钮模块 //顶部预约专家,即时倾诉,心理课堂,心理测试按钮模块
is HomeButtonBannerViewHolder -> { is HomeButtonBannerViewHolder -> {
listenFree?.let { holder.buttonBannerView.setVisibilityFree(it) }
} }
//咨询模块 //咨询模块
is HomeConsultViewHolder -> { is HomeConsultViewHolder -> {
......
...@@ -365,7 +365,6 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm ...@@ -365,7 +365,6 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
home_swipe_refresh_layout.isRefreshing = false home_swipe_refresh_layout.isRefreshing = false
//更新首页数据 //更新首页数据
adapter?.updateItems(list) adapter?.updateItems(list)
adapter?.notifyDataSetChanged()
if (!TextUtils.isEmpty(list[0].headerBean?.doctorName)) { if (!TextUtils.isEmpty(list[0].headerBean?.doctorName)) {
doctorName = list[0].headerBean?.doctorName!! doctorName = list[0].headerBean?.doctorName!!
initSearchBar() initSearchBar()
......
...@@ -30,9 +30,14 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent: ...@@ -30,9 +30,14 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
init { init {
initView() initView()
} }
fun setVisibilityFree(boolean: Boolean){
if (boolean){
qingsuGif.visibility=View.VISIBLE
}else{
qingsuGif.visibility=View.GONE
}
}
private fun initView() { private fun initView() {
LogUtil.e("aaaaa"+listenFree)
val params = RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) val params = RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params layoutParams = params
View.inflate(mContext, R.layout.home_button_banner_view, this) View.inflate(mContext, R.layout.home_button_banner_view, this)
......
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