Search in sources :

Example 6 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)

Example 7 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 8 with ImageLoaderConfiguration

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

Example 9 with ImageLoaderConfiguration

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

Example 10 with ImageLoaderConfiguration

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();
}
Also used : SpannableStringBuilder(android.text.SpannableStringBuilder) LruMemoryCache(com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache) ImageLoaderConfiguration(com.nostra13.universalimageloader.core.ImageLoaderConfiguration)

Aggregations

ImageLoaderConfiguration (com.nostra13.universalimageloader.core.ImageLoaderConfiguration)33 DisplayImageOptions (com.nostra13.universalimageloader.core.DisplayImageOptions)16 LruMemoryCache (com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache)12 Md5FileNameGenerator (com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator)10 File (java.io.File)8 FadeInBitmapDisplayer (com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer)6 UnlimitedDiscCache (com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiscCache)4 HashCodeFileNameGenerator (com.nostra13.universalimageloader.cache.disc.naming.HashCodeFileNameGenerator)4 BaseImageDownloader (com.nostra13.universalimageloader.core.download.BaseImageDownloader)4 UnlimitedDiskCache (com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiskCache)3 Intent (android.content.Intent)2 ImageLoader (com.nostra13.universalimageloader.core.ImageLoader)2 BaseImageDecoder (com.nostra13.universalimageloader.core.decode.BaseImageDecoder)2 SimpleBitmapDisplayer (com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer)2 SharedPreferences (android.content.SharedPreferences)1 Handler (android.os.Handler)1 ActionBar (android.support.v7.app.ActionBar)1 SpannableStringBuilder (android.text.SpannableStringBuilder)1 View (android.view.View)1 ListView (android.widget.ListView)1