package com.zj365.health.adapter

import com.chad.library.adapter.base.entity.MultiItemEntity
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.xty.base.adapter.BaseAdapter
import com.zj365.health.R

class XTangAdapter(var type: Int): BaseAdapter<MultiItemEntity>(R.layout.child_xtang_layout) {

    override fun convert(holder: BaseViewHolder, item: MultiItemEntity) {
        when(type) {
            //动态血糖
            1 -> {
                holder.setVisible(R.id.mTv1, true)
                holder.setVisible(R.id.mTv2, true)
                holder.setVisible(R.id.mTv3, true)
                holder.setVisible(R.id.mTv4, true)
                holder.setText(R.id.mTv1, "状态")
                holder.setText(R.id.mTv2, "理想")
                holder.setText(R.id.mTv3, "尚可")
                holder.setText(R.id.mTv4, "差")
            }
            //糖化血红蛋白
            2 -> {
                holder.setVisible(R.id.mTv1, true)
                holder.setVisible(R.id.mTv2, true)
                holder.setVisible(R.id.mTv3, false)
                holder.setVisible(R.id.mTv4, false)
                holder.setText(R.id.mTv1, "HbA1c范围")
                holder.setText(R.id.mTv2, "血糖控制情况")
            }
        }
    }
}