package com.mints.goodmoney.ui.adapter;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;

import com.mints.goodmoney.R;
import com.mints.goodmoney.mvp.model.BannerBean;
import com.mints.library.utils.GlideUtils;


/**
 * 描述：轮播图Adapter
 * 作者：孟崔广
 * 时间：2018/5/13 16:36
 * 邮箱：mengcg@xiaojinqb.cn
 */
public class BannerAdapter extends BannerBaseAdapter<BannerBean.ListBean> {

    private Context mContext;

    public BannerAdapter(Context context) {
        super(context);
        this.mContext = context;
    }

    @Override
    protected int getLayoutResID() {
        return R.layout.item_banner;
    }

    @Override
    protected void convert(View convertView, BannerBean.ListBean data) {
        if (TextUtils.isEmpty(data.getImgUrl())) {
            setImage(R.id.pageImage, 0);
        } else {
//            GlideUtils.loadImageViewLoding(mContext, data.getBanner_image_url(), getView(R.id.pageImage), R.mipmap.bg_home_banner, R.mipmap.bg_home_banner);
//            GlideUtils.loadImageView(mContext, data.getImgUrl(), getView(R.id.pageImage));
            GlideUtils.loadImageViewLoding(mContext, data.getImgUrl(), getView(R.id.pageImage),R.mipmap.ic_banner_none);
        }
    }
}
