package com.example.chemical.ui.adapter;

import android.text.TextUtils;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.rc.httpcore.bean.HxpChemicalVo;
import com.example.chemical.R;

import java.util.List;

public class SelectChemicalDialogAdapter extends BaseQuickAdapter<HxpChemicalVo, BaseViewHolder> {
    public SelectChemicalDialogAdapter(int layoutResId, @Nullable List<HxpChemicalVo> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, HxpChemicalVo hxpChemicalVo) {
        baseViewHolder.setText(R.id.chemicalName, TextUtils.isEmpty(hxpChemicalVo.getChemicalName()) ? "" : hxpChemicalVo.getChemicalName());
        baseViewHolder.setText(R.id.casNum, TextUtils.isEmpty(hxpChemicalVo.getCasNum()) ? "" : hxpChemicalVo.getCasNum());
        baseViewHolder.setText(R.id.chemicalPurity, TextUtils.isEmpty(hxpChemicalVo.getChemicalPurity()) ? "" : hxpChemicalVo.getChemicalPurity());
    }
}
