Commit 5d070de9 by 霍志良

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

parent a358fcc2
......@@ -2,6 +2,7 @@ package com.yidianling.im.session.extension;
import com.alibaba.fastjson.JSON;
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.QuestionItemBean;
import com.yidianling.uikit.custom.http.response.RecommendExpertBean;
......@@ -36,6 +37,7 @@ public class CustomAttachLingxiWhichQuestion extends CustomAttachment {
this.questionId = data.getString(QUESTIONID);
this.questionTitle = data.getString(QUESTIONTITLE);
this.selectType = data.getString(SELECTTYPE);
LogUtil.e("aaaaa"+data.getString(SELECTVALS));
this.selectVals=(ArrayList<QuestionItemBean>)JSON.parseArray(data.getString(SELECTVALS), QuestionItemBean.class);
}
......@@ -51,4 +53,5 @@ public class CustomAttachLingxiWhichQuestion extends CustomAttachment {
data.put(SELECTVALS, selectVals);
return data;
}
}
......@@ -41,7 +41,7 @@ class AdapterLingxiMultipleChoice : RecyclerView.Adapter<AdapterLingxiMultipleCh
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
holder.tvWhichQuestion.text=tagList[position].name
holder.tvWhichQuestion.text=tagList[position].value
holder.tvWhichQuestion.setOnClickListener {
onItemClickListener?.onMultipleItemClick(
tagList[position], position
......
......@@ -23,7 +23,6 @@ import kotlin.properties.Delegates
class AdapterLingxiWhichQuestion : RecyclerView.Adapter<AdapterLingxiWhichQuestion.ViewHolder>() {
private lateinit var tagList:List<QuestionItemBean>
private var isSingleOrMultiple by Delegates.notNull<Boolean>()
private var onItemClickListener: OnQuestionlItemClickListener? = null
class ViewHolder(itemView: View) :
......@@ -46,7 +45,7 @@ class AdapterLingxiWhichQuestion : RecyclerView.Adapter<AdapterLingxiWhichQuesti
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
holder.tvWhichQuestion.text = tagList[position].name
holder.tvWhichQuestion.text = tagList[position].value
if (tagList[position].isSelected!!){
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))
......
......@@ -13,6 +13,6 @@ data class LingxiWhichQuestionBean(
)
data class QuestionItemBean(
var id:String?,
var name:String?,
var value:String?,
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