use of com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiscCache in project UltimateAndroid by cymcsg.
the class UniversalImageLoader method getDefaultImageLoaderConfigurationBuilder.
public static ImageLoaderConfiguration.Builder getDefaultImageLoaderConfigurationBuilder(Context context) {
File cacheDir = StorageUtils.getCacheDirectory(context);
ImageLoaderConfiguration.Builder builder = new ImageLoaderConfiguration.Builder(context).threadPoolSize(// default
3).threadPriority(// default
Thread.NORM_PRIORITY - 1).tasksProcessingOrder(// default
QueueProcessingType.FIFO).denyCacheImageMultipleSizesInMemory().memoryCacheSizePercentage(// default
13).discCache(// default
new UnlimitedDiscCache(cacheDir)).discCacheFileCount(1000).discCacheFileNameGenerator(// default
new HashCodeFileNameGenerator()).imageDownloader(// default
new BaseImageDownloader(context)).imageDecoder(// default
new BaseImageDecoder(false)).defaultDisplayImageOptions(getDefaultImageOptions());
return builder;
}
use of com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiscCache in project BaseProject by fly803.
the class AppApplication method initImageLoader.
private void initImageLoader() {
// 初始化 Image-Loader
DisplayImageOptions options = new DisplayImageOptions.Builder().cacheInMemory(true).cacheOnDisk(true).build();
ImageLoaderConfiguration configuration = new ImageLoaderConfiguration.Builder(this).memoryCache(new LruMemoryCache(MEMORY_SIZE)).diskCache(new UnlimitedDiscCache(new File(getCacheDir(), "caches"))).diskCacheSize(DISK_SIZE).defaultDisplayImageOptions(options).build();
ImageLoader.getInstance().init(configuration);
}
use of com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiscCache in project ABPlayer by winkstu.
the class HomePageFragment method initImageLoader.
private void initImageLoader() {
File cacheDir = com.nostra13.universalimageloader.utils.StorageUtils.getOwnCacheDirectory(this.getActivity().getApplicationContext(), IMAGE_CACHE_PATH);
DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder().cacheInMemory(true).cacheOnDisc(true).build();
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this.getActivity()).defaultDisplayImageOptions(defaultOptions).memoryCache(new LruMemoryCache(12 * 1024 * 1024)).memoryCacheSize(12 * 1024 * 1024).discCacheSize(32 * 1024 * 1024).discCacheFileCount(100).discCache(new UnlimitedDiscCache(cacheDir)).threadPriority(Thread.NORM_PRIORITY - 2).tasksProcessingOrder(QueueProcessingType.LIFO).build();
ImageLoader.getInstance().init(config);
}
use of com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiscCache in project KenBurnsView by flavioarfaria.
the class FromURLActivity method loadImage.
private void loadImage() {
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
String cacheDirName = "." + getString(R.string.app_name);
cacheDir = new File(Environment.getExternalStorageDirectory(), cacheDirName);
} else {
cacheDir = getCacheDir();
}
if (!cacheDir.exists()) {
cacheDir.mkdirs();
}
config = new ImageLoaderConfiguration.Builder(this).memoryCache(new WeakMemoryCache()).denyCacheImageMultipleSizesInMemory().diskCache(new UnlimitedDiscCache(cacheDir)).threadPoolSize(5).build();
options = new DisplayImageOptions.Builder().bitmapConfig(Bitmap.Config.RGB_565).imageScaleType(ImageScaleType.IN_SAMPLE_INT).cacheOnDisk(true).cacheInMemory(true).build();
imageLoader.init(config);
imageLoader.displayImage("http://i.imgur.com/gysR4Ee.jpg", mImg, options, this);
}
use of com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiscCache in project ABPlayer by winkstu.
the class VideoInfoFragment method initImageLoader.
private void initImageLoader() {
File cacheDir = com.nostra13.universalimageloader.utils.StorageUtils.getOwnCacheDirectory(this.getActivity().getApplicationContext(), IMAGE_CACHE_PATH);
DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder().cacheInMemory(true).cacheOnDisc(true).build();
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this.getActivity()).defaultDisplayImageOptions(defaultOptions).memoryCache(new LruMemoryCache(12 * 1024 * 1024)).memoryCacheSize(12 * 1024 * 1024).discCacheSize(32 * 1024 * 1024).discCacheFileCount(100).discCache(new UnlimitedDiscCache(cacheDir)).threadPriority(Thread.NORM_PRIORITY - 2).tasksProcessingOrder(QueueProcessingType.LIFO).build();
ImageLoader.getInstance().init(config);
}
Aggregations