package com.cooleshow.teacher.adapter;

import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.cooleshow.base.utils.GlideUtils;
import com.cooleshow.teacher.R;
import com.cooleshow.teacher.bean.TeacherSelfStyleInfoBean;

import androidx.annotation.NonNull;

/**
 * Author by pq, Date on 2022/5/10.
 */
public class MineStyleVideoListAdapter extends BaseQuickAdapter<TeacherSelfStyleInfoBean.StyleVideoBean, BaseViewHolder> {
    public static final String VIDEO_AUDIT_STATUS_DOING = "DOING";//审核中
    public static final String VIDEO_AUDIT_STATUS_PASS = "PASS";//审核通过
    public static final String VIDEO_AUDIT_STATUS_UNPASS = "UNPASS";//审核失败

    public MineStyleVideoListAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder holder, TeacherSelfStyleInfoBean.StyleVideoBean styleVideoBean) {
        //加载视频缩略图
        ImageView iv_video_bg =holder.getView(R.id.iv_video_bg);
        GlideUtils.INSTANCE.loadVideoThumbnail(getContext(),styleVideoBean.videoUrl,iv_video_bg);

        //视频审核状态
        TextView tv_audit_status = holder.getView(R.id.tv_audit_status);
        if (TextUtils.equals(VIDEO_AUDIT_STATUS_DOING, styleVideoBean.authStatus)) {
            tv_audit_status.setVisibility(View.VISIBLE);
            tv_audit_status.setText("审核中");
        } else if (TextUtils.equals(VIDEO_AUDIT_STATUS_UNPASS, styleVideoBean.authStatus)) {
            tv_audit_status.setVisibility(View.VISIBLE);
            tv_audit_status.setText("审核失败");
        } else {
            tv_audit_status.setVisibility(View.GONE);
        }
    }
}
