package com.cooleshow.teacher.adapter;

import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.module.BaseLoadMoreModule;
import com.chad.library.adapter.base.module.LoadMoreModule;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.cooleshow.base.utils.GlideUtils;
import com.cooleshow.teacher.R;
import com.cooleshow.teacher.bean.MineLiveCourseListBean;
import com.cooleshow.teacher.bean.MineVideoCourseListBean;
import com.cooleshow.teacher.bean.VideoCourseListBean;

import java.util.List;

/**
 * 创建日期：2022/5/20 14:11
 *
 * @author Ryan
 * 类说明：
 */
public class MineVideoCourseAdapter extends BaseQuickAdapter<VideoCourseListBean.RowsBean, BaseViewHolder> implements LoadMoreModule {

    public MineVideoCourseAdapter(List<VideoCourseListBean.RowsBean> data) {
        super(R.layout.layout_mine_video_course_item, data);
    }


    @Override
    protected void convert(BaseViewHolder helper, VideoCourseListBean.RowsBean item) {
        ImageView im_pic = helper.getView(R.id.im_pic);
        GlideUtils.INSTANCE.loadImage(getContext(), item.lessonCoverUrl, im_pic);
        TextView tv_title=helper.getView(R.id.tv_title);
        tv_title.setText(item.lessonName);
        ImageView im_header=helper.getView(R.id.im_header);

        TextView  tv_teacher_name=helper.getView(R.id.tv_teacher_name);
        tv_teacher_name.setText(item.username);
//        GlideUtils.INSTANCE.loadImage(getContext(), item.avatar, im_header,R.drawable.icon_teacher_default_head);
        TextView tv_price=helper.getView(R.id.tv_price);
//        tv_price.setText("￥"+item.coursePrice+"/"+item.courseNum+"课时");
        String price = "￥" + item.lessonPrice + "/" + item.lessonCount + "课时";
        tv_price.setText( price);
    }

    @NonNull
    @Override
    public BaseLoadMoreModule addLoadMoreModule(@NonNull BaseQuickAdapter<?, ?> baseQuickAdapter) {
        return new BaseLoadMoreModule(baseQuickAdapter);
    }

}
