package com.rv.home.rv.module.ui.main.home.order.adapter;


import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.rv.home.R;
import com.rv.home.R2;
import com.rv.home.rv.module.ui.main.home.order.bean.CancelTheTripBean;

/**
 * 取消行程item
 */
public class CancelTheTripAdapter extends BaseQuickAdapter<CancelTheTripBean, BaseViewHolder> {


    public CancelTheTripAdapter() {
        super(R.layout.rv_item_cancel_the_trip);
    }

    private int selectPosition;
    @Override
    protected void convert(BaseViewHolder helper, CancelTheTripBean item) {
        helper.setText(R.id.tv_content,item.getName());
        if(selectPosition==mData.indexOf(item)){
            helper.setChecked(R.id.rg_check,true);
        }else {
            helper.setChecked(R.id.rg_check,false);
        }
    }

    public void setSelectPosition(int position){
        this.selectPosition=position;
        notifyDataSetChanged();
    }

    public String getSelectName(){
        return mData.get(selectPosition).getName();
    }
}
