Commit 02dbf89f by 严久程

华为渠道区分

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