use of com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator in project PhotoNoter by yydcdut.
the class ImageLoaderManager method init.
public static void init(Context context) {
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context).threadPriority(Thread.NORM_PRIORITY - 2).denyCacheImageMultipleSizesInMemory().discCacheFileNameGenerator(new Md5FileNameGenerator()).tasksProcessingOrder(QueueProcessingType.LIFO).build();
ImageLoader.getInstance().init(config);
sOptions = new DisplayImageOptions.Builder().cacheInMemory(//设置下载的图片是否缓存在内存中
true).considerExifParams(//是否考虑JPEG图像EXIF参数(旋转,翻转)
true).bitmapConfig(//设置图片的解码类型//
Bitmap.Config.RGB_565).build();
//构建完成
}
use of com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator in project ZhihuDailyPurify by izzyleung.
the class ZhihuDailyPurifyApplication method initImageLoader.
public static void initImageLoader(Context context) {
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context).denyCacheImageMultipleSizesInMemory().threadPriority(Thread.NORM_PRIORITY - 2).diskCacheFileNameGenerator(new Md5FileNameGenerator()).tasksProcessingOrder(QueueProcessingType.LIFO).build();
ImageLoader.getInstance().init(config);
}
use of com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator in project SimplifyReader by chentao0707.
the class ImageLoaderHelper method getImageLoaderConfiguration.
public ImageLoaderConfiguration getImageLoaderConfiguration(String filePath) {
File cacheDir = null;
if (!CommonUtils.isEmpty(filePath)) {
cacheDir = StorageUtils.getOwnCacheDirectory(mContext, filePath);
} else {
cacheDir = StorageUtils.getCacheDirectory(mContext);
}
ImageLoaderConfiguration.Builder builder = new ImageLoaderConfiguration.Builder(mContext);
builder.denyCacheImageMultipleSizesInMemory();
builder.diskCacheSize(512 * 1024 * 1024);
builder.diskCacheExtraOptions(720, 1280, null);
builder.diskCache(new UnlimitedDiscCache(cacheDir));
builder.diskCacheFileNameGenerator(new Md5FileNameGenerator());
builder.memoryCacheSizePercentage(14);
builder.memoryCacheSize(2 * 1024 * 1024);
builder.memoryCacheExtraOptions(720, 1280);
builder.memoryCache(new WeakMemoryCache());
builder.threadPoolSize(3);
builder.threadPriority(Thread.NORM_PRIORITY - 2);
builder.defaultDisplayImageOptions(getDisplayOptions());
return builder.build();
}
use of com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator in project android-ui-design-pattern by MathieuCalba.
the class UIDesignPatternApplication method onCreate.
@Override
public void onCreate() {
super.onCreate();
final DisplayImageOptions defaultDisplayImageOptions = //
new DisplayImageOptions.Builder().cacheInMemory().cacheOnDisc().displayer(//
new FadeInBitmapDisplayer(250)).showImageForEmptyUri(//
R.drawable.ic_launcher).showStubImage(//
R.drawable.ic_launcher).build();
final File cacheDir = StorageUtils.getOwnCacheDirectory(getApplicationContext(), "YANA/ImageCache");
final ImageLoaderConfiguration config = //
new ImageLoaderConfiguration.Builder(getApplicationContext()).defaultDisplayImageOptions(//
defaultDisplayImageOptions).discCache(//
new TotalSizeLimitedDiscCache(cacheDir, new Md5FileNameGenerator(), 10 * 1024 * 1024)).imageDownloader(//
new URLConnectionImageDownloader()).memoryCacheSize(// 2 Mb
2 * 1024 * 1024).tasksProcessingOrder(//
QueueProcessingType.LIFO).threadPoolSize(//
3).threadPriority(//
Thread.NORM_PRIORITY - 2).build();
ImageLoader.getInstance().init(config);
}
use of com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator in project StickerCamera by Skykai521.
the class App method initImageLoader.
private void initImageLoader() {
DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder().cacheInMemory(false).imageScaleType(ImageScaleType.EXACTLY).cacheOnDisk(true).build();
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this).threadPriority(Thread.NORM_PRIORITY - 2).defaultDisplayImageOptions(defaultOptions).denyCacheImageMultipleSizesInMemory().diskCacheFileNameGenerator(new Md5FileNameGenerator()).diskCache(new UnlimitedDiskCache(StorageUtils.getOwnCacheDirectory(this, AppConstants.APP_IMAGE))).diskCacheSize(100 * 1024 * 1024).tasksProcessingOrder(QueueProcessingType.LIFO).memoryCache(new LruMemoryCache(2 * 1024 * 1024)).memoryCacheSize(2 * 1024 * 1024).threadPoolSize(3).build();
ImageLoader.getInstance().init(config);
}
Aggregations