use of com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache in project ABPlayer by winkstu.
the class HomePageFragment2 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.memory.impl.LruMemoryCache 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);
}
use of com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache in project YourAppIdea by Michenux.
the class YourApplication method onCreate.
@Override
public void onCreate() {
super.onCreate();
this.injectSelf();
// Enable tutorial sync
this.tutorialSyncHelper.createTutorialAccount(this);
// Initialize Universal Image Loader
// Create global configuration and initialize ImageLoader with this configuration
DisplayImageOptions options = new DisplayImageOptions.Builder().cacheInMemory(// default
true).cacheOnDisk(// default
true).displayer(// default SimpleBitmapDisplayer,RoundedBitmapDisplayer(10),FadeInBitmapDisplayer
new FadeInBitmapDisplayer(5000)).build();
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext()).memoryCache(new LruMemoryCache(2 * 1024 * 1024)).memoryCacheSizePercentage(// default
13).defaultDisplayImageOptions(// default
options).build();
ImageLoader.getInstance().init(config);
}
Aggregations