package com.common.im.adapter;

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

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.common.im_ui.R;
import com.cooleshow.base.utils.GlideUtils;
import com.luck.picture.lib.entity.LocalMedia;

import java.util.List;

/**
 * 创建日期：2022/6/13 14:22
 *
 * @author Ryan
 * 类说明：
 */
public class AddPhotoListAdapter extends BaseQuickAdapter<LocalMedia, BaseViewHolder> {

    public AddPhotoListAdapter(List<LocalMedia> data) {
        super(R.layout.photo_list_item, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, LocalMedia item) {
        ImageView ivIcon = helper.getView(R.id.iv_icon);
        if (item.getPath().equals("123")){
            ivIcon.setBackgroundResource(com.cooleshow.base.R.drawable.bg_add_photo_shape);
            ivIcon.setImageResource(R.drawable.ic_update_photo);
        }else{
            GlideUtils.INSTANCE.loadImage(getContext(), item.getPath(), ivIcon);
        }

    }

}
