Commit 02dbf89f by 严久程

华为渠道区分

parent 40bf9ef2
......@@ -46,7 +46,7 @@ ext {
"m-consultant" : "0.0.58.8",
"m-fm" : "0.0.29.3",
"m-user" : "0.0.60.3",
"m-home" : "0.0.20.9",
"m-home" : "0.0.21.1",
"m-im" : "0.0.17.4",
"m-dynamic" : "0.0.7.5",
......
......@@ -2,13 +2,14 @@ package com.yidianling.home.adapter
import android.content.Context
import android.support.v7.widget.RecyclerView
import android.text.TextUtils
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.ydl.ydlcommon.data.PlatformDataManager.getRam
import com.yidianling.home.R
import com.yidianling.home.constract.YdlHomeViewHolderConstract
import com.yidianling.home.event.HomeImpl
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.HomeAskBean
import com.yidianling.home.model.bean.HomeConfideBean
import com.yidianling.home.model.bean.HomeConsultBean
......@@ -22,9 +23,11 @@ import com.yidianling.home.ui.view.*
* @Company 壹点灵
* @date 2019/02/13
*/
class YdlHomeAdapter(private val mContext: Context,
private var homeEvent: HomeImpl,
private var list: ArrayList<HomePagerDataBean>) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
class YdlHomeAdapter(
private val mContext: Context,
private var homeEvent: HomeImpl,
private var list: ArrayList<HomePagerDataBean>
) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
private val mInflater: LayoutInflater = LayoutInflater.from(mContext)
/**
......@@ -141,11 +144,17 @@ class YdlHomeAdapter(private val mContext: Context,
when (holder) {
//顶部预约专家,即时倾诉,心理课堂,心理测试按钮模块
is HomeButtonBannerViewHolder -> {
holder.buttonBannerView.initData(list[position].headerBean?.homeSaleData,list[position].headerBean?.askCategoryData)
holder.buttonBannerView.initData(
list[position].headerBean?.homeSaleData,
list[position].headerBean?.askCategoryData
)
}
//倾诉*排解模块
is HomeConfideViewHolder -> {
holder.confideViewView.setTitle(list[position].headerBean?.listenCategoryDate, confideSelectPosition)
holder.confideViewView.setTitle(
list[position].headerBean?.listenCategoryDate,
confideSelectPosition
)
holder.confideViewView.setConfideExpertInfoView(list[position].confideBean?.body)
confidePosition = position
}
......@@ -155,7 +164,15 @@ class YdlHomeAdapter(private val mContext: Context,
}
//解忧*问答模块
is HomeAssuageGriefViewHolder -> {
holder.assuageGriefViewView.initData(position, list[position].askBean?.data)
val ffrom =
getRam().getChannelName()
if (!TextUtils.isEmpty(ffrom) && ffrom.endsWith("huawei")) {
val parm = holder.itemView.layoutParams
parm.height = 0
holder.itemView.layoutParams = parm
} else {
holder.assuageGriefViewView.initData(position, list[position].askBean?.data)
}
}
//文章*阅读模块
is HomeArticleViewHolder -> {
......@@ -163,8 +180,14 @@ class YdlHomeAdapter(private val mContext: Context,
}
//咨询模块
is HomeConsultViewHolder -> {
holder.consultView.setTitle(list[position].headerBean?.consultCategoryData, consultSelectPosition)
holder.consultView.setConsultInfoView(list[position].consultBean?.list,list[position].headerBean?.consultCategoryData?.get(consultSelectPosition))
holder.consultView.setTitle(
list[position].headerBean?.consultCategoryData,
consultSelectPosition
)
holder.consultView.setConsultInfoView(
list[position].consultBean?.list,
list[position].headerBean?.consultCategoryData?.get(consultSelectPosition)
)
consultPosition = position
}
//测试模块
......@@ -177,25 +200,30 @@ class YdlHomeAdapter(private val mContext: Context,
override fun getItemCount(): Int {
return list.size
}
/**
* 顶部预约专家,即时倾诉,心理测试按钮模块 ViewHolder
*/
inner class HomeButtonBannerViewHolder(val buttonBannerView: HomeButtonBannerView) : RecyclerView.ViewHolder(buttonBannerView)
inner class HomeButtonBannerViewHolder(val buttonBannerView: HomeButtonBannerView) :
RecyclerView.ViewHolder(buttonBannerView)
/**
* 咨询模块 ViewHolder
*/
inner class HomeConsultViewHolder(val consultView: HomeConsultView) : RecyclerView.ViewHolder(consultView)
inner class HomeConsultViewHolder(val consultView: HomeConsultView) :
RecyclerView.ViewHolder(consultView)
/**
* 倾诉*排解模块 ViewHolder
*/
inner class HomeConfideViewHolder(val confideViewView: HomeConfideView) : RecyclerView.ViewHolder(confideViewView)
inner class HomeConfideViewHolder(val confideViewView: HomeConfideView) :
RecyclerView.ViewHolder(confideViewView)
/**
* 课程*成长模块 ViewHolder
*/
inner class HomeCourseViewHolder(val courseViewView: HomeCourseView) : RecyclerView.ViewHolder(courseViewView)
inner class HomeCourseViewHolder(val courseViewView: HomeCourseView) :
RecyclerView.ViewHolder(courseViewView)
/**
* 测试模块 ViewHolder
......@@ -205,11 +233,14 @@ class YdlHomeAdapter(private val mContext: Context,
/**
* 解忧*问答模块 ViewHolder
*/
inner class HomeAssuageGriefViewHolder(val assuageGriefViewView: HomeAssuageGriefView) : RecyclerView.ViewHolder(assuageGriefViewView)
inner class HomeAssuageGriefViewHolder(val assuageGriefViewView: HomeAssuageGriefView) :
RecyclerView.ViewHolder(assuageGriefViewView)
/**
* 文章*阅读模块 ViewHolder
*/
inner class HomeArticleViewHolder(val articleViewView: HomeArticleView) : RecyclerView.ViewHolder(articleViewView)
inner class HomeArticleViewHolder(val articleViewView: HomeArticleView) :
RecyclerView.ViewHolder(articleViewView)
/**
* 底部提示语模块 ViewHolder
......
package com.yidianling.home.ui.view
import android.content.Context
import android.graphics.Color
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
......@@ -33,6 +34,7 @@ class HomeAssuageGriefView(private val mContext: Context, private var homeEvent:
)
layoutParams = params
View.inflate(mContext, R.layout.home_assuage_grief_view, this)
setBackgroundColor(Color.GREEN)
homeModuleAssuageGriefViewHomeCommonTitleView.setTitle("解忧·问答")
homeModuleAssuageGriefViewHomeCommonTitleView.setOnClickListener {
homeEvent?.askMoreClick()
......@@ -42,6 +44,7 @@ class HomeAssuageGriefView(private val mContext: Context, private var homeEvent:
fun initData(position: Int, list: List<HomeAskBean.DataBean>?) {
//添加View
if (list == null) {
visibility = View.GONE
return
}
if (cacheList.size != list?.size) {
......
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