package com.wisewoods.eduandroid.ui.adapter;

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

import org.jetbrains.annotations.NotNull;

public class MessageAdapter extends BasePageAdapter<MsgList.MsgBean> {
    public MessageAdapter() {
        super(R.layout.item_recycler_message);
        addChildClickViewIds(R.id.tv_complete);
    }

    @Override
    protected void convert(@NotNull BaseVH baseVH, MsgList.MsgBean msgBean) {
        baseVH.setText(R.id.tv_time, msgBean.createTime)
                .setText(R.id.tv_content, msgBean.sendContent)
                .setText(R.id.tv_tag, msgBean.messageType == 1 ? "待办消息" : "其他消息")
                .setTextLeft(R.id.tv_tag, msgBean.messageType == 1 ?
                        R.drawable.shape_message_other : R.drawable.shape_message_system)
                .setGone(R.id.tv_complete, "1".equals(msgBean.readStatus))
                .setGone(R.id.v_line, "1".equals(msgBean.readStatus))
        ;

    }
}
