package com.wisewoods.eduandroid.ui.adapter;

import android.text.TextUtils;

import com.wisewoods.base.base.BaseVH;
import com.wisewoods.base.bean.MettingInfo;
import com.wisewoods.base.page.BasePageAdapter;
import com.wisewoods.eduandroid.R;

import org.jetbrains.annotations.NotNull;

public class HistoryAdapter extends BasePageAdapter<MettingInfo.DataBean> {
    public HistoryAdapter() {
        super(R.layout.item_recycler_history);
        addChildClickViewIds(R.id.tv_detail, R.id.tv_record);
    }


    @Override
    protected void convert(@NotNull BaseVH baseVH, MettingInfo.DataBean dataBean) {
        String name = dataBean.subject;
        if (!TextUtils.isEmpty(dataBean.venue)) {
            name = name + "(" + dataBean.venue + ")";
        }
        baseVH
                .setText(R.id.tv_num, dataBean.meetingCode)
                .setText(R.id.tv_name, name)
                .setText(R.id.tv_time, "会议时间：" + dataBean.startTime
                        + " — " + dataBean.endTime + "\n发起人：" + dataBean.createName)
        ;
    }
}
