package com.unis.sxzcl.ui.person;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.module.LoadMoreModule;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.unis.model.bean.person.PersonBean;
import com.unis.sxzcl.R;

import org.jetbrains.annotations.NotNull;


/**
 * 包名: com.unis.sxzcl.ui.person
 * 类名: PersonListAdapter
 * 作用描述:
 * 创建人: mQ
 * 创建时间: 2020/11/30 19:57
 * 更新人:
 * 更新时间: 2020/11/30 19:57
 * 更新说明:
 * 版本号: 1.0
 */
public class PersonListAdapter extends BaseQuickAdapter<PersonBean, BaseViewHolder> implements LoadMoreModule {

    public PersonListAdapter() {
        super(R.layout.item_list_person);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder holder, PersonBean item) {
        ImageView imageView = holder.getView(R.id.iv_show);
        Glide.with(getContext())
                .load(R.drawable.no_banner)
                .placeholder(R.drawable.ic_img_loading)
                .error(R.drawable.no_banner)
                .into(imageView);

        holder.setText(R.id.tv_name, item.getUname())
                .setText(R.id.tv_post, item.getPpost());
    }
}
