Search in sources :

Example 11 with Md5FileNameGenerator

use of com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator in project SeaStar by 13120241790.

the class App method onCreate.

@Override
public void onCreate() {
    super.onCreate();
    // rongcloud 初始化
    RongIM.init(this);
    if (getApplicationInfo().packageName.equals(getCurProcessName(getApplicationContext()))) {
        RongCloudEvent.init(this);
        RongIM.registerMessageType(AgreedFriendRequestMessage.class);
        RongIM.registerMessageTemplate(new ContactNotificationMessageProvider());
    }
    // BugTags 初始化
    Bugtags.start(BUGTAGS_APPKEY, this, Bugtags.BTGInvocationEventBubble);
    //友盟session时间间隔
    MobclickAgent.setSessionContinueMillis(30 * 60 * 1000);
    //oneCore 打印参数
    NLog.setDebug(true);
    options = new DisplayImageOptions.Builder().showImageForEmptyUri(R.drawable.rp_default_head).showImageOnFail(R.drawable.rp_default_head).showImageOnLoading(R.drawable.rp_default_head).displayer(new FadeInBitmapDisplayer(300)).cacheInMemory(true).cacheOnDisk(true).build();
    //初始化图片下载组件
    ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext()).threadPriority(Thread.NORM_PRIORITY - 2).denyCacheImageMultipleSizesInMemory().diskCacheSize(50 * 1024 * 1024).diskCacheFileCount(200).diskCacheFileNameGenerator(new Md5FileNameGenerator()).defaultDisplayImageOptions(options).build();
    //Initialize ImageLoader with configuration.
    ImageLoader.getInstance().init(config);
}
Also used : ContactNotificationMessageProvider(com.rongseal.message.ContactNotificationMessageProvider) FadeInBitmapDisplayer(com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer) Md5FileNameGenerator(com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator) ImageLoaderConfiguration(com.nostra13.universalimageloader.core.ImageLoaderConfiguration)

Example 12 with Md5FileNameGenerator

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

the class GalleryApplication method onCreate.

@Override
public void onCreate() {
    super.onCreate();
    if (BuildConfig.LOG_DEBUG) {
        LeakCanary.install(this);
    }
    YLog.setDEBUG(BuildConfig.LOG_DEBUG);
    ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this).threadPriority(Thread.NORM_PRIORITY - 2).denyCacheImageMultipleSizesInMemory().discCacheFileNameGenerator(new Md5FileNameGenerator()).tasksProcessingOrder(QueueProcessingType.LIFO).build();
    ImageLoader.getInstance().init(config);
    DisplayImageOptions sOptions = new DisplayImageOptions.Builder().cacheInMemory(//设置下载的图片是否缓存在内存中
    true).considerExifParams(//是否考虑JPEG图像EXIF参数(旋转,翻转)
    true).bitmapConfig(//设置图片的解码类型//
    Bitmap.Config.RGB_565).build();
    //构建完成
    PGEditImageLoader.initImageLoader(this);
    PGEditSDK.instance().initSDK(this);
}
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