private void initEmptyFieldsWithDefaultValues()
 {
     if (taskExecutor == null)
     {
         taskExecutor = DefaultConfigurationFactory.createExecutor(threadPoolSize, threadPriority, tasksProcessingType);
     } else
     {
         customExecutor = true;
     }
     if (taskExecutorForCachedImages == null)
     {
         taskExecutorForCachedImages = DefaultConfigurationFactory.createExecutor(threadPoolSize, threadPriority, tasksProcessingType);
     } else
     {
         customExecutorForCachedImages = true;
     }
     if (diskCache == null)
     {
         if (diskCacheFileNameGenerator == null)
         {
             diskCacheFileNameGenerator = DefaultConfigurationFactory.createFileNameGenerator();
         }
         diskCache = DefaultConfigurationFactory.createDiskCache(context, diskCacheFileNameGenerator, diskCacheSize, diskCacheFileCount);
     }
     if (memoryCache == null)
     {
         memoryCache = DefaultConfigurationFactory.createMemoryCache(memoryCacheSize);
     }
     if (denyCacheImageMultipleSizesInMemory)
     {
         memoryCache = new FuzzyKeyMemoryCache(memoryCache, MemoryCacheUtils.createFuzzyKeyComparator());
     }
     if (downloader == null)
     {
         downloader = DefaultConfigurationFactory.createImageDownloader(context);
     }
     if (decoder == null)
     {
         decoder = DefaultConfigurationFactory.createImageDecoder(writeLogs);
     }
     if (defaultDisplayImageOptions == null)
     {
         defaultDisplayImageOptions = DisplayImageOptions.createSimple();
     }
 }
 private void initEmptyFiledsWithDefaultValues() {
   if (discCache == null) {
     if (discCacheFileNameGenerator == null) {
       discCacheFileNameGenerator = DefaultConfigurationFactory.createFileNameGenerator();
     }
     discCache =
         DefaultConfigurationFactory.createDiscCache(
             context, discCacheFileNameGenerator, discCacheSize, discCacheFileCount);
   }
   if (memoryCache == null) {
     memoryCache =
         DefaultConfigurationFactory.createMemoryCache(
             memoryCacheSize, denyCacheImageMultipleSizesInMemory);
   }
   if (downloader == null) {
     downloader = DefaultConfigurationFactory.createImageDownloader(context);
   }
   if (defaultDisplayImageOptions == null) {
     defaultDisplayImageOptions = DisplayImageOptions.createSimple();
   }
 }
Esempio n. 3
0
 /**
  * @param cacheDir Directory for file caching. <b>Important:</b> Specify separate folder for
  *     cached files. It's needed for right cache limit work.
  * @param sizeLimit Cache limit value. If cache exceeds this limit then file with the most oldest
  *     last usage date will be deleted.
  */
 public LimitedDiscCache(File cacheDir, int sizeLimit) {
   this(cacheDir, DefaultConfigurationFactory.createFileNameGenerator(), sizeLimit);
 }
 /**
  * @param cacheDir Directory for file caching. <b>Important:</b> Specify separate folder for
  *     cached files. It's needed for right cache limit work.
  * @param maxCacheSize Maximum cache directory size (in bytes). If cache size exceeds this limit
  *     then file with the most oldest last usage date will be deleted.
  */
 public TotalSizeLimitedDiscCache(File cacheDir, int maxCacheSize) {
   this(cacheDir, DefaultConfigurationFactory.createFileNameGenerator(), maxCacheSize);
 }