use of com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache in project 9GAG by stormzhang.
the class App method initImageLoader.
// 初始化ImageLoader
public static void initImageLoader(Context context) {
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context).threadPriority(Thread.NORM_PRIORITY - 2).denyCacheImageMultipleSizesInMemory().memoryCache(new LruMemoryCache(2 * 1024 * 1024)).discCacheSize(10 * 1024 * 1024).discCacheFileNameGenerator(new Md5FileNameGenerator()).tasksProcessingOrder(QueueProcessingType.LIFO).build();
ImageLoader.getInstance().init(config);
}
use of com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache in project cardslib by gabrielemariotti.
the class UniversalImageLoaderFragment method initUniversalImageLoaderLibrary.
/**
* Android-Universal-Image-Loader config.
*
* DON'T COPY THIS CODE TO YOUR REAL PROJECT! *
* I would recommend doing it in an overloaded Application.onCreate().
* It is just for test purpose
*
*
*/
private void initUniversalImageLoaderLibrary() {
File cacheDir = StorageUtils.getCacheDirectory(getActivity());
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getActivity()).memoryCache(new LruMemoryCache(2 * 1024 * 1024)).defaultDisplayImageOptions(DisplayImageOptions.createSimple()).writeDebugLogs().build();
ImageLoader.getInstance().init(config);
options = new DisplayImageOptions.Builder().cacheInMemory(true).displayer(new SimpleBitmapDisplayer()).showImageOnFail(R.drawable.ic_error_loadingsmall).build();
}
use of com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache in project android-page-transition by xmuSistone.
the class MainActivity method initImageLoader.
@SuppressWarnings("deprecation")
private void initImageLoader() {
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this).memoryCacheExtraOptions(480, 800).threadPoolSize(3).threadPriority(Thread.NORM_PRIORITY - 1).tasksProcessingOrder(QueueProcessingType.FIFO).denyCacheImageMultipleSizesInMemory().memoryCache(new LruMemoryCache(2 * 1024 * 1024)).memoryCacheSize(2 * 1024 * 1024).memoryCacheSizePercentage(// default
13).discCacheSize(// 缓冲大小
50 * 1024 * 1024).discCacheFileCount(// 缓冲文件数目
100).discCacheFileNameGenerator(// default
new HashCodeFileNameGenerator()).imageDownloader(// default
new BaseImageDownloader(this)).defaultDisplayImageOptions(// default
DisplayImageOptions.createSimple()).writeDebugLogs().build();
// 2.单例ImageLoader类的初始化
ImageLoader imageLoader = ImageLoader.getInstance();
imageLoader.init(config);
}
use of com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache in project android-card-slide-panel by xmuSistone.
the class MainActivity method initImageLoader.
@SuppressWarnings("deprecation")
private void initImageLoader() {
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this).memoryCacheExtraOptions(480, 800).threadPoolSize(3).threadPriority(Thread.NORM_PRIORITY - 1).tasksProcessingOrder(QueueProcessingType.FIFO).denyCacheImageMultipleSizesInMemory().memoryCache(new LruMemoryCache(2 * 1024 * 1024)).memoryCacheSize(2 * 1024 * 1024).memoryCacheSizePercentage(// default
13).discCacheSize(// 缓冲大小
50 * 1024 * 1024).discCacheFileCount(// 缓冲文件数目
100).discCacheFileNameGenerator(// default
new HashCodeFileNameGenerator()).imageDownloader(// default
new BaseImageDownloader(this)).defaultDisplayImageOptions(// default
DisplayImageOptions.createSimple()).writeDebugLogs().build();
// 2.单例ImageLoader类的初始化
ImageLoader imageLoader = ImageLoader.getInstance();
imageLoader.init(config);
}
use of com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache in project DanmakuFlameMaster by Bilibili.
the class UglyViewCacheStufferSampleActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Create global configuration and initialize ImageLoader with this config
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this).memoryCache(new LruMemoryCache(2 * 1024 * 1024)).memoryCacheSize(2 * 1024 * 1024).memoryCacheSizePercentage(13).build();
ImageLoader.getInstance().init(config);
setContentView(R.layout.activity_main);
findViews();
}
Aggregations