public class GlideImageLoader extends com.youth.banner.loader.ImageLoader{ private ImageLoader imageLoader; private DisplayImageOptions options; @Override public void displayImage(Context context, Object path, ImageView imageView) { imageLoader = ImageLoader.getInstance(); File file = new File(Environment.getExternalStorageDirectory()+"/IMG"); if (!file.exists()){ file.mkdirs(); } ImageLoaderConfiguration configuration = new ImageLoaderConfiguration.Builder(context) .diskCache(new UnlimitedDiskCache(file)) .build(); imageLoader.init(configuration); options = new DisplayImageOptions.Builder() .cacheInMemory(true) .cacheOnDisk(true) .bitmapConfig(Bitmap.Config.ARGB_8888) .showImageForEmptyUri(R.mipmap.ic_launcher) .showImageOnFail(R.mipmap.ic_launcher) .build(); imageLoader.displayImage((String) path,imageView); } }
imageloader
最新推荐文章于 2018-10-12 14:30:04 发布