package com.zj365.health.act.datamanage

import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.xty.base.adapter.BaseAdapter
import com.zj365.health.R
import com.zj365.health.model.XZhiCompareDataBean

class XZhiCompareDataListAdapter : BaseAdapter<XZhiCompareDataBean>(R.layout.item_xzhi_compare_data) {
    override fun convert(holder: BaseViewHolder, item: XZhiCompareDataBean) {
        holder.setText(R.id.tvCompareName,item.compareName)
        holder.setText(R.id.tvContrastData,"${item.compareValue}mmol/L")
        holder.setText(R.id.tvSelectData,"${item.chooseValue}mmol/L")
        if(item.chooseValue < item.compareValue){
            holder.setImageResource(R.id.ivDataContrastImg,R.mipmap.xiajiang)
        }else if(item.chooseValue > item.compareValue){
            holder.setImageResource(R.id.ivDataContrastImg,R.mipmap.shangsheng)
        }else{
            holder.setImageResource(R.id.ivDataContrastImg,R.mipmap.xiangt)

        }

    }
}