package com.bc_chat.contacts.adapter;

import android.content.Context;

import com.bc_chat.contacts.R;
import com.bc_chat.contacts.databinding.ItemDynamicImageLayoutBinding;
import com.zhaohaoting.framework.abs.adapter.ListToAdapter;
import com.zhaohaoting.framework.imagepicker.bean.MediaItem;
import com.zhaohaoting.framework.utils.glid.GlideUtils;

import java.util.List;

/**
 * author：Created by zhaohaoting on 2019/8/27
 * email：526309416@qq.com
 * desc：
 */
public class DynamicImageAdapter extends ListToAdapter<MediaItem, List<MediaItem>> {

    public DynamicImageAdapter(Context context) {
        super(context);
    }

    @Override
    protected int getItemLayoutId(int type) {
        return R.layout.item_dynamic_image_layout;
    }

    @Override
    protected void onBindViewHolderHF(BaseViewHolder baseViewHolder, int realPosition, MediaItem mediaItem) {
        ItemDynamicImageLayoutBinding binding = (ItemDynamicImageLayoutBinding) baseViewHolder.getDataBinding();
        GlideUtils.loadRoundImage(context, mediaItem.path, binding.ivImage, 4);
    }
}
