Search in sources :

Example 1 with ImageLoaderConfiguration

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);
}
Also used : ConfigurationBuilder(org.acra.config.ConfigurationBuilder) ACRAConfiguration(org.acra.config.ACRAConfiguration) ACRAConfigurationException(org.acra.config.ACRAConfigurationException) ImageLoaderConfiguration(com.nostra13.universalimageloader.core.ImageLoaderConfiguration)

Example 2 with ImageLoaderConfiguration

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);
}
Also used : ImageLoaderConfiguration(com.nostra13.universalimageloader.core.ImageLoaderConfiguration)

Example 3 with ImageLoaderConfiguration

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;
}
Also used : ImageLoaderConfiguration(com.nostra13.universalimageloader.core.ImageLoaderConfiguration)

Example 4 with ImageLoaderConfiguration

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);
}
Also used : HashCodeFileNameGenerator(com.nostra13.universalimageloader.cache.disc.naming.HashCodeFileNameGenerator) LruMemoryCache(com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache) BaseImageDownloader(com.nostra13.universalimageloader.core.download.BaseImageDownloader) ImageLoader(com.nostra13.universalimageloader.core.ImageLoader) ImageLoaderConfiguration(com.nostra13.universalimageloader.core.ImageLoaderConfiguration)

Example 5 with ImageLoaderConfiguration

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);
}
Also used : Md5FileNameGenerator(com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator) ImageLoaderConfiguration(com.nostra13.universalimageloader.core.ImageLoaderConfiguration)

Aggregations

ImageLoaderConfiguration (com.nostra13.universalimageloader.core.ImageLoaderConfiguration)51 DisplayImageOptions (com.nostra13.universalimageloader.core.DisplayImageOptions)24 File (java.io.File)19 LruMemoryCache (com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache)17 Md5FileNameGenerator (com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator)13 UnlimitedDiskCache (com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiskCache)12 BaseImageDownloader (com.nostra13.universalimageloader.core.download.BaseImageDownloader)10 HashCodeFileNameGenerator (com.nostra13.universalimageloader.cache.disc.naming.HashCodeFileNameGenerator)9 FadeInBitmapDisplayer (com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer)9 UnlimitedDiscCache (com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiscCache)5 WeakMemoryCache (com.nostra13.universalimageloader.cache.memory.impl.WeakMemoryCache)4 ImageLoader (com.nostra13.universalimageloader.core.ImageLoader)4 BaseImageDecoder (com.nostra13.universalimageloader.core.decode.BaseImageDecoder)3 IOException (java.io.IOException)3 Intent (android.content.Intent)2 SharedPreferences (android.content.SharedPreferences)2 Handler (android.os.Handler)2 StrictMode (android.os.StrictMode)2 DiskCache (com.nostra13.universalimageloader.cache.disc.DiskCache)2 LruDiskCache (com.nostra13.universalimageloader.cache.disc.impl.ext.LruDiskCache)2