Skip to content

Commit

Permalink
update english readMe
Browse files Browse the repository at this point in the history
  • Loading branch information
程王勇 authored and 程王勇 committed Jun 10, 2017
1 parent 407a495 commit 7881873
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions imageframelibs/src/main/java/com/mrwang/imageframe/ImageCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,21 @@ public class ImageCache {
public ImageCache() {
mReusableBitmaps =
Collections.synchronizedSet(new HashSet<SoftReference<Bitmap>>());
long memCacheSize = Runtime.getRuntime().freeMemory() / 100;
long memCacheSize = Runtime.getRuntime().freeMemory() / 8;
if (memCacheSize <= 0) {
memCacheSize = 1;
}
// If you're running on Honeycomb or newer, create a
// synchronized HashSet of references to reusable bitmaps.
mMemoryCache = new LruCache<String, BitmapDrawable>((int) memCacheSize) {

// // Notify the removed entry that is no longer being cached.
// @Override
// protected void entryRemoved(boolean evicted, String key,
// BitmapDrawable oldValue, BitmapDrawable newValue) {
// //Log.i("TAG","mReusableBitmaps add2");
// //mReusableBitmaps.add(new SoftReference<>(oldValue.getBitmap()));
// }
// // Notify the removed entry that is no longer being cached.
// @Override
// protected void entryRemoved(boolean evicted, String key,
// BitmapDrawable oldValue, BitmapDrawable newValue) {
// //Log.i("TAG","mReusableBitmaps add2");
// //mReusableBitmaps.add(new SoftReference<>(oldValue.getBitmap()));
// }
@Override
protected int sizeOf(String key, BitmapDrawable value) {
return value.getBitmap().getByteCount();
Expand Down

0 comments on commit 7881873

Please sign in to comment.