Picasso

Picasso

简介

xxx

依赖

implementation 'com.squareup.picasso:picasso:2.4.0'

PicassoLoader

package util;

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

import com.self.zsp.dfs.R;
import com.squareup.picasso.Picasso;

import java.io.File;

/**
 * Created on 2019/4/12.
 *
 * @author 郑少鹏
 * @desc PicassoLoader
 */
public class PicassoLoader {
    /**
     * 加载缩略图
     *
     * @param context   上下文
     * @param path      路径
     * @param imageView 控件
     */
    public static void loadThumbnail(Context context, String path, ImageView imageView) {
        Picasso.with(context).load(Uri.fromFile(new File(path))).placeholder(R.color.placeHolder)
                .resize(999, 999)
                .centerCrop()
                .into(imageView);
    }
}