コード例 #1
0
ファイル: BitmapCache.java プロジェクト: hellosmile/xUtils
 public void clearMemoryCache(String uri) {
   MemoryCacheKey key = new MemoryCacheKey(uri, null);
   if (mMemoryCache != null) {
     while (mMemoryCache.containsKey(key)) {
       mMemoryCache.remove(key);
     }
   }
 }
コード例 #2
0
ファイル: BitmapCache.java プロジェクト: hellosmile/xUtils
 /**
  * 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
ファイル: BitmapCache.java プロジェクト: hellosmile/xUtils
 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
ファイル: BitmapCache.java プロジェクト: hellosmile/xUtils
 public void clearMemoryCache() {
   if (mMemoryCache != null) {
     mMemoryCache.evictAll();
   }
 }
コード例 #5
0
ファイル: BitmapCache.java プロジェクト: hellosmile/xUtils
 public void setMemoryCacheSize(int maxSize) {
   if (mMemoryCache != null) {
     mMemoryCache.setMaxSize(maxSize);
   }
 }