Commit a68b3493 by 霍志良

feat:心理咨询代码修改

parent 0897b40c
......@@ -154,7 +154,7 @@ class YdlHomeAdapter(
//顶部预约专家,即时倾诉,心理课堂,心理测试按钮模块
is HomeButtonBannerViewHolder -> {
holder.buttonBannerView.initData(
list[position].headerBean?.askCategoryData
list[position].headerBean?.goldList
)
}
//倾诉*排解模块
......
......@@ -54,7 +54,7 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
fun initData(
homeCategory: List<HomeHeaderBean.AskCategoryDataBean>?
homeCategory: List<HomeHeaderBean.CategoryGoldListDataBean>?
) {
homeEvent?.let { home_category_view.setEvent(it) }
home_category_view.initData(homeCategory)
......
......@@ -30,7 +30,8 @@ class HomePagerBannerCategoryView(mContext: Context, homeEvent: IHomeBaseEvent)
/**
* 数据缓存
*/
var mDataList: ArrayList<HomeHeaderBean.AskCategoryDataBean>? = null
var mDataList: ArrayList<HomeHeaderBean.CategoryGoldListDataBean>? = null
/**
* 分类view宽度
*/
......@@ -113,7 +114,7 @@ class HomePagerBannerCategoryView(mContext: Context, homeEvent: IHomeBaseEvent)
}
fun initData(
askCategoryDataBean: List<HomeHeaderBean.AskCategoryDataBean>?,
askCategoryDataBean: List<HomeHeaderBean.CategoryGoldListDataBean>?,
homeSaleData: List<HomeHeaderBean.HomeSaleDataBean>?
) {
if (null == askCategoryDataBean || askCategoryDataBean.isEmpty()) {
......@@ -136,17 +137,16 @@ class HomePagerBannerCategoryView(mContext: Context, homeEvent: IHomeBaseEvent)
* 判断数据是否变化
*/
private fun getChange(
bean: List<HomeHeaderBean.AskCategoryDataBean>?,
cacheBean: List<HomeHeaderBean.AskCategoryDataBean>?
bean: List<HomeHeaderBean.CategoryGoldListDataBean>?,
cacheBean: List<HomeHeaderBean.CategoryGoldListDataBean>?
): Boolean {
if (bean?.size != cacheBean?.size) {
return true
}
for (index in 0 until bean?.size!!) {
if (!bean[index].url.equals(cacheBean!![index].url)
|| !bean[index].coverUrl.equals(cacheBean!![index].coverUrl)
|| !bean[index].cateTitle.equals(cacheBean!![index].cateTitle)
|| bean[index].cateId != cacheBean!![index].cateId
if (!bean[index].icon.equals(cacheBean!![index].icon)
|| !bean[index].title.equals(cacheBean!![index].title)
|| bean[index].id != cacheBean!![index].id
) {
return true
}
......@@ -218,9 +218,9 @@ class HomePagerBannerCategoryView(mContext: Context, homeEvent: IHomeBaseEvent)
*/
private fun bindIconData(
imageView: ImageView,
categoryBean: HomeHeaderBean.AskCategoryDataBean
categoryBean: HomeHeaderBean.CategoryGoldListDataBean
) {
GlideApp.with(context).load(categoryBean.coverUrl)
GlideApp.with(context).load(categoryBean.icon)
.centerCrop().into(imageView)
}
......@@ -249,8 +249,11 @@ class HomePagerBannerCategoryView(mContext: Context, homeEvent: IHomeBaseEvent)
/**
* 设置文本
*/
private fun bindTextData(textView: TextView, categoryBean: HomeHeaderBean.AskCategoryDataBean) {
textView.text = categoryBean.cateTitle
private fun bindTextData(
textView: TextView,
categoryBean: HomeHeaderBean.CategoryGoldListDataBean
) {
textView.text = categoryBean.title
}
/**
......
......@@ -30,7 +30,8 @@ class HomeModuleCategoryView : FrameLayout {
/**
* 数据缓存
*/
var mDataList: ArrayList<HomeHeaderBean.AskCategoryDataBean>? = null
var mDataList: ArrayList<HomeHeaderBean.CategoryGoldListDataBean>? = null
/**
* 分类view宽度
*/
......@@ -126,7 +127,7 @@ class HomeModuleCategoryView : FrameLayout {
dp15 = RxImageTool.dip2px(4f)
}
fun initData(askCategoryDataBean: List<HomeHeaderBean.AskCategoryDataBean>?) {
fun initData(askCategoryDataBean: List<HomeHeaderBean.CategoryGoldListDataBean>?) {
if (null == askCategoryDataBean || askCategoryDataBean.isEmpty()) {
visibility = View.GONE
return
......@@ -146,17 +147,16 @@ class HomeModuleCategoryView : FrameLayout {
* 判断数据是否变化
*/
private fun getChange(
bean: List<HomeHeaderBean.AskCategoryDataBean>?,
cacheBean: List<HomeHeaderBean.AskCategoryDataBean>?
bean: List<HomeHeaderBean.CategoryGoldListDataBean>?,
cacheBean: List<HomeHeaderBean.CategoryGoldListDataBean>?
): Boolean {
if (bean?.size != cacheBean?.size) {
return true
}
for (index in 0 until bean?.size!!) {
if (!bean[index].url.equals(cacheBean!![index].url)
|| !bean[index].coverUrl.equals(cacheBean!![index].coverUrl)
|| !bean[index].cateTitle.equals(cacheBean!![index].cateTitle)
|| bean[index].cateId != cacheBean!![index].cateId
if (!bean[index].icon.equals(cacheBean!![index].icon)
|| !bean[index].title.equals(cacheBean!![index].title)
|| bean[index].id != cacheBean!![index].id
) {
return true
}
......@@ -282,8 +282,11 @@ class HomeModuleCategoryView : FrameLayout {
/**
* 设置文本
*/
private fun bindTextData(textView: TextView, categoryBean: HomeHeaderBean.AskCategoryDataBean) {
textView.text = categoryBean.cateTitle
private fun bindTextData(
textView: TextView,
categoryBean: HomeHeaderBean.CategoryGoldListDataBean
) {
textView.text = categoryBean.title
}
/**
......@@ -291,9 +294,9 @@ class HomeModuleCategoryView : FrameLayout {
*/
private fun bindIconData(
imageView: ImageView,
categoryBean: HomeHeaderBean.AskCategoryDataBean
categoryBean: HomeHeaderBean.CategoryGoldListDataBean
) {
GlideApp.with(context).load(categoryBean.coverUrl)
GlideApp.with(context).load(categoryBean.icon)
.centerCrop().into(imageView)
}
}
\ No newline at end of file
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