package com.itant.shiwushu.tool;

import android.app.Activity;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.request.RequestOptions;
import com.itant.shiwushu.R;
import com.itant.shiwushu.widget.GlideCircleTransform;

/**
 * Created by Jason on 2018/10/3.
 */

public class GlideTool {
    public static void loadStrokeRound(Activity activity, int resourceId, float borderWidth, ImageView targetView) {
        Glide.with(activity).load(resourceId)
                .apply(new RequestOptions().diskCacheStrategy(DiskCacheStrategy.RESOURCE)
                        .placeholder(R.mipmap.logo)
                        .centerCrop()
                        .transform(new GlideCircleTransform(activity, borderWidth, activity.getResources().getColor(R.color.white))))
                .into(targetView);
    }
}
