Commit 5d070de9 by 霍志良

feat:im-灵犀2.0-更新本地消息

parent a358fcc2
...@@ -2,6 +2,7 @@ package com.yidianling.im.session.extension; ...@@ -2,6 +2,7 @@ package com.yidianling.im.session.extension;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yidianling.common.tools.LogUtil;
import com.yidianling.im.session.viewholder.bean.LingxiWhichQuestionBean; import com.yidianling.im.session.viewholder.bean.LingxiWhichQuestionBean;
import com.yidianling.im.session.viewholder.bean.QuestionItemBean; import com.yidianling.im.session.viewholder.bean.QuestionItemBean;
import com.yidianling.uikit.custom.http.response.RecommendExpertBean; import com.yidianling.uikit.custom.http.response.RecommendExpertBean;
...@@ -36,6 +37,7 @@ public class CustomAttachLingxiWhichQuestion extends CustomAttachment { ...@@ -36,6 +37,7 @@ public class CustomAttachLingxiWhichQuestion extends CustomAttachment {
this.questionId = data.getString(QUESTIONID); this.questionId = data.getString(QUESTIONID);
this.questionTitle = data.getString(QUESTIONTITLE); this.questionTitle = data.getString(QUESTIONTITLE);
this.selectType = data.getString(SELECTTYPE); this.selectType = data.getString(SELECTTYPE);
LogUtil.e("aaaaa"+data.getString(SELECTVALS));
this.selectVals=(ArrayList<QuestionItemBean>)JSON.parseArray(data.getString(SELECTVALS), QuestionItemBean.class); this.selectVals=(ArrayList<QuestionItemBean>)JSON.parseArray(data.getString(SELECTVALS), QuestionItemBean.class);
} }
...@@ -51,4 +53,5 @@ public class CustomAttachLingxiWhichQuestion extends CustomAttachment { ...@@ -51,4 +53,5 @@ public class CustomAttachLingxiWhichQuestion extends CustomAttachment {
data.put(SELECTVALS, selectVals); data.put(SELECTVALS, selectVals);
return data; return data;
} }
} }
...@@ -41,7 +41,7 @@ class AdapterLingxiMultipleChoice : RecyclerView.Adapter<AdapterLingxiMultipleCh ...@@ -41,7 +41,7 @@ class AdapterLingxiMultipleChoice : RecyclerView.Adapter<AdapterLingxiMultipleCh
} }
override fun onBindViewHolder(holder: ViewHolder, position: Int) { override fun onBindViewHolder(holder: ViewHolder, position: Int) {
holder.tvWhichQuestion.text=tagList[position].name holder.tvWhichQuestion.text=tagList[position].value
holder.tvWhichQuestion.setOnClickListener { holder.tvWhichQuestion.setOnClickListener {
onItemClickListener?.onMultipleItemClick( onItemClickListener?.onMultipleItemClick(
tagList[position], position tagList[position], position
......
...@@ -23,7 +23,6 @@ import kotlin.properties.Delegates ...@@ -23,7 +23,6 @@ import kotlin.properties.Delegates
class AdapterLingxiWhichQuestion : RecyclerView.Adapter<AdapterLingxiWhichQuestion.ViewHolder>() { class AdapterLingxiWhichQuestion : RecyclerView.Adapter<AdapterLingxiWhichQuestion.ViewHolder>() {
private lateinit var tagList:List<QuestionItemBean> private lateinit var tagList:List<QuestionItemBean>
private var isSingleOrMultiple by Delegates.notNull<Boolean>() private var isSingleOrMultiple by Delegates.notNull<Boolean>()
private var onItemClickListener: OnQuestionlItemClickListener? = null private var onItemClickListener: OnQuestionlItemClickListener? = null
class ViewHolder(itemView: View) : class ViewHolder(itemView: View) :
...@@ -46,7 +45,7 @@ class AdapterLingxiWhichQuestion : RecyclerView.Adapter<AdapterLingxiWhichQuesti ...@@ -46,7 +45,7 @@ class AdapterLingxiWhichQuestion : RecyclerView.Adapter<AdapterLingxiWhichQuesti
} }
override fun onBindViewHolder(holder: ViewHolder, position: Int) { override fun onBindViewHolder(holder: ViewHolder, position: Int) {
holder.tvWhichQuestion.text = tagList[position].name holder.tvWhichQuestion.text = tagList[position].value
if (tagList[position].isSelected!!){ if (tagList[position].isSelected!!){
holder.tvWhichQuestion.background=ContextCompat.getDrawable(holder.itemView.context,R.drawable.im_background_18dp_1da1f2) holder.tvWhichQuestion.background=ContextCompat.getDrawable(holder.itemView.context,R.drawable.im_background_18dp_1da1f2)
holder.tvWhichQuestion.setTextColor(ContextCompat.getColor(holder.itemView.context,R.color.white)) holder.tvWhichQuestion.setTextColor(ContextCompat.getColor(holder.itemView.context,R.color.white))
...@@ -54,10 +53,10 @@ class AdapterLingxiWhichQuestion : RecyclerView.Adapter<AdapterLingxiWhichQuesti ...@@ -54,10 +53,10 @@ class AdapterLingxiWhichQuestion : RecyclerView.Adapter<AdapterLingxiWhichQuesti
holder.tvWhichQuestion.background=ContextCompat.getDrawable(holder.itemView.context,R.drawable.im_background_18dp_e8f5fe) holder.tvWhichQuestion.background=ContextCompat.getDrawable(holder.itemView.context,R.drawable.im_background_18dp_e8f5fe)
holder.tvWhichQuestion.setTextColor(ContextCompat.getColor(holder.itemView.context,R.color.platform_color_1DA1F2)) holder.tvWhichQuestion.setTextColor(ContextCompat.getColor(holder.itemView.context,R.color.platform_color_1DA1F2))
} }
holder.tvWhichQuestion.setOnClickListener { holder.tvWhichQuestion.setOnClickListener {
onItemClickListener?.onItemClick( onItemClickListener?.onItemClick(
tagList[position],position) tagList[position],position)
} }
if(isSingleOrMultiple){ if(isSingleOrMultiple){
holder.tvWhichQuestion.setPadding(RxImageTool.dip2px(62f),RxImageTool.dp2px(8f),RxImageTool.dip2px(62f),RxImageTool.dp2px(8f)) holder.tvWhichQuestion.setPadding(RxImageTool.dip2px(62f),RxImageTool.dp2px(8f),RxImageTool.dip2px(62f),RxImageTool.dp2px(8f))
} }
......
...@@ -13,6 +13,6 @@ data class LingxiWhichQuestionBean( ...@@ -13,6 +13,6 @@ data class LingxiWhichQuestionBean(
) )
data class QuestionItemBean( data class QuestionItemBean(
var id:String?, var id:String?,
var name:String?, var value:String?,
var isSelected: Boolean?=false var isSelected: Boolean?=false
) )
\ 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