Search in sources :

Example 6 with Md5FileNameGenerator

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();
//构建完成
}
Also used : Md5FileNameGenerator(com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator) ImageLoaderConfiguration(com.nostra13.universalimageloader.core.ImageLoaderConfiguration) DisplayImageOptions(com.nostra13.universalimageloader.core.DisplayImageOptions)

Example 7 with Md5FileNameGenerator

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);
}
Also used : Md5FileNameGenerator(com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator) ImageLoaderConfiguration(com.nostra13.universalimageloader.core.ImageLoaderConfiguration)

Example 8 with Md5FileNameGenerator

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();
}
Also used : UnlimitedDiscCache(com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiscCache) Md5FileNameGenerator(com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator) WeakMemoryCache(com.nostra13.universalimageloader.cache.memory.impl.WeakMemoryCache) File(java.io.File) ImageLoaderConfiguration(com.nostra13.universalimageloader.core.ImageLoaderConfiguration)

Example 9 with Md5FileNameGenerator

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);
}
Also used : TotalSizeLimitedDiscCache(com.nostra13.universalimageloader.cache.disc.impl.TotalSizeLimitedDiscCache) FadeInBitmapDisplayer(com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer) Md5FileNameGenerator(com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator) File(java.io.File) ImageLoaderConfiguration(com.nostra13.universalimageloader.core.ImageLoaderConfiguration) URLConnectionImageDownloader(com.nostra13.universalimageloader.core.download.URLConnectionImageDownloader) DisplayImageOptions(com.nostra13.universalimageloader.core.DisplayImageOptions)

Example 10 with Md5FileNameGenerator

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);
}
Also used : UnlimitedDiskCache(com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiskCache) Md5FileNameGenerator(com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator) LruMemoryCache(com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache) ImageLoaderConfiguration(com.nostra13.universalimageloader.core.ImageLoaderConfiguration) DisplayImageOptions(com.nostra13.universalimageloader.core.DisplayImageOptions)

Aggregations

Md5FileNameGenerator (com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator)12 ImageLoaderConfiguration (com.nostra13.universalimageloader.core.ImageLoaderConfiguration)12 DisplayImageOptions (com.nostra13.universalimageloader.core.DisplayImageOptions)5 LruMemoryCache (com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache)2 FadeInBitmapDisplayer (com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer)2 File (java.io.File)2 TotalSizeLimitedDiscCache (com.nostra13.universalimageloader.cache.disc.impl.TotalSizeLimitedDiscCache)1 UnlimitedDiscCache (com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiscCache)1 UnlimitedDiskCache (com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiskCache)1 WeakMemoryCache (com.nostra13.universalimageloader.cache.memory.impl.WeakMemoryCache)1 URLConnectionImageDownloader (com.nostra13.universalimageloader.core.download.URLConnectionImageDownloader)1 ContactNotificationMessageProvider (com.rongseal.message.ContactNotificationMessageProvider)1