Пример #1
0
 public void clearMemoryCache(String uri) {
   MemoryCacheKey key = new MemoryCacheKey(uri, null);
   if (mMemoryCache != null) {
     while (mMemoryCache.containsKey(key)) {
       mMemoryCache.remove(key);
     }
   }
 }
Пример #2
0
 /**
  * Get the bitmap from memory cache.
  *
  * @param uri Unique identifier for which item to get
  * @param config
  * @return The bitmap if found in cache, null otherwise
  */
 public Bitmap getBitmapFromMemCache(String uri, BitmapDisplayConfig config) {
   if (mMemoryCache != null && globalConfig.isMemoryCacheEnabled()) {
     MemoryCacheKey key = new MemoryCacheKey(uri, config);
     return mMemoryCache.get(key);
   }
   return null;
 }
Пример #3
0
 private void addBitmapToMemoryCache(
     String uri, BitmapDisplayConfig config, Bitmap bitmap, long expiryTimestamp)
     throws IOException {
   if (uri != null
       && bitmap != null
       && globalConfig.isMemoryCacheEnabled()
       && mMemoryCache != null) {
     MemoryCacheKey key = new MemoryCacheKey(uri, config);
     mMemoryCache.put(key, bitmap, expiryTimestamp);
   }
 }
Пример #4
0
 public void clearMemoryCache() {
   if (mMemoryCache != null) {
     mMemoryCache.evictAll();
   }
 }
Пример #5
0
 public void setMemoryCacheSize(int maxSize) {
   if (mMemoryCache != null) {
     mMemoryCache.setMaxSize(maxSize);
   }
 }