Search in sources :

Example 1 with Md5FileNameGenerator

use of com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator in project Android-Universal-Image-Loader by nostra13.

the class UILApplication method initImageLoader.

public static void initImageLoader(Context context) {
    // This configuration tuning is custom. You can tune every option, you may tune some of them,
    // or you can create default configuration by
    //  ImageLoaderConfiguration.createDefault(this);
    // method.
    ImageLoaderConfiguration.Builder config = new ImageLoaderConfiguration.Builder(context);
    config.threadPriority(Thread.NORM_PRIORITY - 2);
    config.denyCacheImageMultipleSizesInMemory();
    config.diskCacheFileNameGenerator(new Md5FileNameGenerator());
    // 50 MiB
    config.diskCacheSize(50 * 1024 * 1024);
    config.tasksProcessingOrder(QueueProcessingType.LIFO);
    // Remove for release app
    config.writeDebugLogs();
    // Initialize ImageLoader with configuration.
    ImageLoader.getInstance().init(config.build());
}
Also used : Md5FileNameGenerator(com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator) ImageLoaderConfiguration(com.nostra13.universalimageloader.core.ImageLoaderConfiguration)

Example 2 with Md5FileNameGenerator

use of com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator in project GalleryFinal by pengjianbo.

the class MainActivity method initImageLoader.

//    @Override
//    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
//        super.onActivityResult(requestCode, resultCode, data);
//        if (requestCode == GalleryFinal.GALLERY_REQUEST_CODE) {
//            if (resultCode == GalleryFinal.GALLERY_RESULT_SUCCESS) {
//                List<PhotoInfo> photoInfoList = (List<PhotoInfo>) data.getSerializableExtra(GalleryFinal.GALLERY_RESULT_LIST_DATA);
//                if (photoInfoList != null) {
//                    mPhotoList.addAll(photoInfoList);
//                    mChoosePhotoListAdapter.notifyDataSetChanged();
//                }
//            }
//        }
//    }
private void initImageLoader(Context context) {
    // This configuration tuning is custom. You can tune every option, you may tune some of them,
    // or you can create default configuration by
    //  ImageLoaderConfiguration.createDefault(this);
    // method.
    ImageLoaderConfiguration.Builder config = new ImageLoaderConfiguration.Builder(context);
    config.threadPriority(Thread.NORM_PRIORITY - 2);
    config.denyCacheImageMultipleSizesInMemory();
    config.diskCacheFileNameGenerator(new Md5FileNameGenerator());
    // 50 MiB
    config.diskCacheSize(50 * 1024 * 1024);
    config.tasksProcessingOrder(QueueProcessingType.LIFO);
    // Remove for release app
    config.writeDebugLogs();
    // Initialize ImageLoader with configuration.
    ImageLoader.getInstance().init(config.build());
}
Also used : Md5FileNameGenerator(com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator) ImageLoaderConfiguration(com.nostra13.universalimageloader.core.ImageLoaderConfiguration)

Example 3 with Md5FileNameGenerator

use of com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator in project 9GAG by stormzhang.

the class App method initImageLoader.

// 初始化ImageLoader
public static void initImageLoader(Context context) {
    ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context).threadPriority(Thread.NORM_PRIORITY - 2).denyCacheImageMultipleSizesInMemory().memoryCache(new LruMemoryCache(2 * 1024 * 1024)).discCacheSize(10 * 1024 * 1024).discCacheFileNameGenerator(new Md5FileNameGenerator()).tasksProcessingOrder(QueueProcessingType.LIFO).build();
    ImageLoader.getInstance().init(config);
}
Also used : Md5FileNameGenerator(com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator) LruMemoryCache(com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache) ImageLoaderConfiguration(com.nostra13.universalimageloader.core.ImageLoaderConfiguration)

Example 4 with Md5FileNameGenerator

use of com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator in project PhotoNoter by yydcdut.

the class PGEditImageLoader method initImageLoader.

public static void initImageLoader(Application application) {
    ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(application).threadPriority(Thread.NORM_PRIORITY - 2).denyCacheImageMultipleSizesInMemory().discCacheFileNameGenerator(new Md5FileNameGenerator()).tasksProcessingOrder(QueueProcessingType.LIFO).writeDebugLogs().build();
    ImageLoader.getInstance().init(config);
}
Also used : Md5FileNameGenerator(com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator) ImageLoaderConfiguration(com.nostra13.universalimageloader.core.ImageLoaderConfiguration)

Example 5 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)

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