|
|
|
@ -23,7 +23,7 @@ import android.text.Spannable;
@@ -23,7 +23,7 @@ import android.text.Spannable;
|
|
|
|
|
import android.text.SpannableString; |
|
|
|
|
import android.text.style.TypefaceSpan; |
|
|
|
|
|
|
|
|
|
import com.nostra13.universalimageloader.cache.disc.impl.ext.LruDiscCache; |
|
|
|
|
import com.nostra13.universalimageloader.cache.disc.impl.ext.LruDiskCache; |
|
|
|
|
import com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator; |
|
|
|
|
import com.nostra13.universalimageloader.cache.memory.impl.UsingFreqLimitedMemoryCache; |
|
|
|
|
import com.nostra13.universalimageloader.core.DisplayImageOptions; |
|
|
|
@ -123,17 +123,17 @@ public class NavigationHelper {
@@ -123,17 +123,17 @@ public class NavigationHelper {
|
|
|
|
|
if (imageCache == null) { |
|
|
|
|
imageCache = ImageLoader.getInstance(); |
|
|
|
|
try { |
|
|
|
|
LruDiscCache diskCache = new LruDiscCache(context.getCacheDir(), null, new Md5FileNameGenerator(), 640000, 25); |
|
|
|
|
LruDiskCache diskCache = new LruDiskCache(context.getCacheDir(), null, new Md5FileNameGenerator(), 640000, 25); |
|
|
|
|
// @formatter:off
|
|
|
|
|
Builder imageCacheBuilder = new Builder(context) |
|
|
|
|
.defaultDisplayImageOptions( |
|
|
|
|
new DisplayImageOptions.Builder() |
|
|
|
|
.cacheInMemory() |
|
|
|
|
.cacheOnDisc() |
|
|
|
|
.cacheInMemory(true) |
|
|
|
|
.cacheOnDisk(true) |
|
|
|
|
.imageScaleType(ImageScaleType.IN_SAMPLE_INT) |
|
|
|
|
.showImageForEmptyUri(R.drawable.ic_launcher).build()) |
|
|
|
|
.memoryCache(new UsingFreqLimitedMemoryCache(1024 * 1024)) |
|
|
|
|
.discCache(diskCache); |
|
|
|
|
.diskCache(diskCache); |
|
|
|
|
imageCache.init(imageCacheBuilder.build()); |
|
|
|
|
// @formatter:on
|
|
|
|
|
} catch (IOException e) { |
|
|
|
|