package com.wasu.cs.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.facebook.drawee.view.SimpleDraweeView;
import com.wasu.frescoimagefetchermodule.FrescoImageFetcherModule;
import com.wasu.widgets.adbanner.Holder;

import cn.com.wasu.main.R;

/**
 * VIP广告适配器
 */
public class ADBannerImageHolderView implements Holder<String> {
    private SimpleDraweeView imageView;
    @Override
    public View createView(Context context) {
        //你可以通过layout文件来创建，也可以像我一样用代码创建，不一定是Image，任何控件都可以进行翻页
        imageView = new SimpleDraweeView(context);
        imageView.setScaleType(ImageView.ScaleType.FIT_XY);
        return imageView;
    }

    @Override
    public void UpdateUI(Context context, int position, String data) {
        imageView.setImageResource(R.drawable.default_wasu_bg);
        FrescoImageFetcherModule.getInstance().attachImage(data, imageView);
    }
}
