package com.dahe.mylibrary.adapter;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.dahe.mylibrary.R;
import com.dahe.mylibrary.bean.StateBean;

import java.util.List;


public class SelectDicAdapter extends BaseQuickAdapter<StateBean, BaseViewHolder> {
    private int selectPos = -1;


    public SelectDicAdapter(int layoutResId, @Nullable List<StateBean> data, int selectPos) {
        super(R.layout.item_dic_select, data);
        this.selectPos = selectPos;
    }

    @Override
    protected void convert(BaseViewHolder helper, StateBean item) {
        helper.setText(R.id.tv_content,item.getDictLabel());
//        TextView tv = helper.getView(R.id.tv_content);
//        if (item.equals(selectString)){
//            tv.setSelected(true);
//        }else{
//            tv.setSelected(false);
//        }

    }

    public void setSelect(int selectString){
        this.selectPos = selectString;
    }
}
