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);
}
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 Timber by naman14.
the class TimberApp method onCreate.
@Override
public void onCreate() {
super.onCreate();
mInstance = this;
//disable crashlytics for debug builds
Crashlytics crashlyticsKit = new Crashlytics.Builder().core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build()).build();
Fabric.with(this, crashlyticsKit);
ImageLoaderConfiguration localImageLoaderConfiguration = new ImageLoaderConfiguration.Builder(this).build();
ImageLoader.getInstance().init(localImageLoaderConfiguration);
L.writeLogs(false);
L.disableLogging();
L.writeDebugLogs(false);
Nammu.init(this);
if (!ATE.config(this, "light_theme").isConfigured()) {
ATE.config(this, "light_theme").activityTheme(R.style.AppThemeLight).primaryColorRes(R.color.colorPrimaryLightDefault).accentColorRes(R.color.colorAccentLightDefault).coloredNavigationBar(false).usingMaterialDialogs(true).commit();
}
if (!ATE.config(this, "dark_theme").isConfigured()) {
ATE.config(this, "dark_theme").activityTheme(R.style.AppThemeDark).primaryColorRes(R.color.colorPrimaryDarkDefault).accentColorRes(R.color.colorAccentDarkDefault).coloredNavigationBar(false).usingMaterialDialogs(true).commit();
}
if (!ATE.config(this, "light_theme_notoolbar").isConfigured()) {
ATE.config(this, "light_theme_notoolbar").activityTheme(R.style.AppThemeLight).coloredActionBar(false).primaryColorRes(R.color.colorPrimaryLightDefault).accentColorRes(R.color.colorAccentLightDefault).coloredNavigationBar(false).usingMaterialDialogs(true).commit();
}
if (!ATE.config(this, "dark_theme_notoolbar").isConfigured()) {
ATE.config(this, "dark_theme_notoolbar").activityTheme(R.style.AppThemeDark).coloredActionBar(false).primaryColorRes(R.color.colorPrimaryDarkDefault).accentColorRes(R.color.colorAccentDarkDefault).coloredNavigationBar(true).usingMaterialDialogs(true).commit();
}
}
use of com.nostra13.universalimageloader.core.ImageLoaderConfiguration in project Wallpaper-Manager by Bencodes.
the class HomeActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.getSupportFragmentManager().addOnBackStackChangedListener(this);
super.setContentView(R.layout.activity_home);
this.loadData(savedInstanceState);
if (savedInstanceState == null) {
BitmapDisplayer displayer = getResources().getBoolean(R.bool.config_enable_image_fade_in) ? new FadeInBitmapDisplayer(getResources().getInteger(R.integer.config_fade_in_time)) : new SimpleBitmapDisplayer();
final DisplayImageOptions options = new DisplayImageOptions.Builder().displayer(displayer).cacheInMemory().cacheOnDisc().build();
final ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this).threadPriority(Thread.NORM_PRIORITY - 1).offOutOfMemoryHandling().tasksProcessingOrder(QueueProcessingType.FIFO).defaultDisplayImageOptions(options).build();
mImageLoader = ImageLoader.getInstance();
mImageLoader.init(config);
}
}
use of com.nostra13.universalimageloader.core.ImageLoaderConfiguration 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