use of com.nostra13.universalimageloader.core.ImageLoaderConfiguration in project NewPipe by TeamNewPipe.
the class App method onCreate.
@Override
public void onCreate() {
super.onCreate();
// init crashreport
try {
final ACRAConfiguration acraConfig = new ConfigurationBuilder(this).setReportSenderFactoryClasses(reportSenderFactoryClasses).build();
ACRA.init(this, acraConfig);
} catch (ACRAConfigurationException ace) {
ace.printStackTrace();
ErrorActivity.reportError(this, ace, null, null, ErrorActivity.ErrorInfo.make(ErrorActivity.SEARCHED, "none", "Could not initialize ACRA crash report", R.string.app_ui_crash));
}
//init NewPipe
NewPipe.init(Downloader.getInstance());
// Initialize image loader
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this).build();
ImageLoader.getInstance().init(config);
/*
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
if(prefs.getBoolean(getString(R.string.use_tor_key), false)) {
OrbotHelper.requestStartTor(this);
configureTor(true);
} else {
configureTor(false);
}*/
configureTor(false);
// DO NOT REMOVE THIS FUNCTION!!!
// Otherwise downloadPathPreference has invalid value.
SettingsActivity.initSettings(this);
}
use of com.nostra13.universalimageloader.core.ImageLoaderConfiguration in project UltimateAndroid by cymcsg.
the class CommonApplication method onCreate.
@Override
public void onCreate() {
super.onCreate();
// Create global configuration and initialize ImageLoader with this configuration
ImageLoaderConfiguration config = UniversalImageLoader.getDefaultImageLoaderConfiguration(getApplicationContext());
ImageLoader.getInstance().init(config);
ActiveAndroid.initialize(this);
}
use of com.nostra13.universalimageloader.core.ImageLoaderConfiguration in project UltimateAndroid by cymcsg.
the class UniversalImageLoader method getDefaultImageLoaderConfiguration.
public static ImageLoaderConfiguration getDefaultImageLoaderConfiguration(Context context, boolean isWriteLog) {
ImageLoaderConfiguration.Builder builder = getDefaultImageLoaderConfigurationBuilder(context);
if (isWriteLog) {
builder.writeDebugLogs();
}
ImageLoaderConfiguration config = builder.build();
return config;
}
use of com.nostra13.universalimageloader.core.ImageLoaderConfiguration 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.core.ImageLoaderConfiguration in project PhotoNoter by yydcdut.
the class PGEditImageLoader method initImageLoader.
public static void initImageLoader(Application application) {
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(application).threadPriority(Thread.NORM_PRIORITY - 2).denyCacheImageMultipleSizesInMemory().discCacheFileNameGenerator(new Md5FileNameGenerator()).tasksProcessingOrder(QueueProcessingType.LIFO).writeDebugLogs().build();
ImageLoader.getInstance().init(config);
}
Aggregations