package com.bxzk.afxj.util;

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

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions;
import com.youth.banner.loader.ImageLoader;

/**
 * Created by shi on 2017/6/9 0009.
 * --------- 日期 ------- 维护人 ------------ 变更内容 --------
 * 2017/6/9 0009        shi             新增Person类
 * 2017/6/9 0009       shi             增加sex属性
 */

public class GlideImageLoader extends ImageLoader {
    @Override
    public void displayImage(Context context, Object path, ImageView imageView) {
        RoundedCorners roundedCorners = new RoundedCorners(10);
//通过RequestOptions扩展功能,override:采样率,因为ImageView就这么大,可以压缩图片,降低内存消耗
        RequestOptions options = RequestOptions.bitmapTransform(roundedCorners).override(300, 300);

        Glide.with(context)

                .load(path)
                .apply(options)
                .into(imageView);

    }


}
