Search in sources :

Example 21 with DisplayImageOptions

use of com.nostra13.universalimageloader.core.DisplayImageOptions in project PhotoNoter by yydcdut.

the class GalleryApplication method onCreate.

@Override
public void onCreate() {
    super.onCreate();
    if (BuildConfig.LOG_DEBUG) {
        LeakCanary.install(this);
    }
    YLog.setDEBUG(BuildConfig.LOG_DEBUG);
    ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this).threadPriority(Thread.NORM_PRIORITY - 2).denyCacheImageMultipleSizesInMemory().discCacheFileNameGenerator(new Md5FileNameGenerator()).tasksProcessingOrder(QueueProcessingType.LIFO).build();
    ImageLoader.getInstance().init(config);
    DisplayImageOptions sOptions = new DisplayImageOptions.Builder().cacheInMemory(//设置下载的图片是否缓存在内存中
    true).considerExifParams(//是否考虑JPEG图像EXIF参数(旋转,翻转)
    true).bitmapConfig(//设置图片的解码类型//
    Bitmap.Config.RGB_565).build();
    //构建完成
    PGEditImageLoader.initImageLoader(this);
    PGEditSDK.instance().initSDK(this);
}
Also used : Md5FileNameGenerator(com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator) ImageLoaderConfiguration(com.nostra13.universalimageloader.core.ImageLoaderConfiguration) DisplayImageOptions(com.nostra13.universalimageloader.core.DisplayImageOptions)

Example 22 with DisplayImageOptions

use of com.nostra13.universalimageloader.core.DisplayImageOptions in project ABPlayer by winkstu.

the class HomePageFragment2 method initImageLoader.

private void initImageLoader() {
    File cacheDir = com.nostra13.universalimageloader.utils.StorageUtils.getOwnCacheDirectory(this.getActivity().getApplicationContext(), IMAGE_CACHE_PATH);
    DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder().cacheInMemory(true).cacheOnDisc(true).build();
    ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this.getActivity()).defaultDisplayImageOptions(defaultOptions).memoryCache(new LruMemoryCache(12 * 1024 * 1024)).memoryCacheSize(12 * 1024 * 1024).discCacheSize(32 * 1024 * 1024).discCacheFileCount(100).discCache(new UnlimitedDiscCache(cacheDir)).threadPriority(Thread.NORM_PRIORITY - 2).tasksProcessingOrder(QueueProcessingType.LIFO).build();
    ImageLoader.getInstance().init(config);
}
Also used : UnlimitedDiscCache(com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiscCache) LruMemoryCache(com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache) File(java.io.File) ImageLoaderConfiguration(com.nostra13.universalimageloader.core.ImageLoaderConfiguration) DisplayImageOptions(com.nostra13.universalimageloader.core.DisplayImageOptions)

Example 23 with DisplayImageOptions

use of com.nostra13.universalimageloader.core.DisplayImageOptions in project ABPlayer by winkstu.

the class VideoInfoFragment method initImageLoader.

private void initImageLoader() {
    File cacheDir = com.nostra13.universalimageloader.utils.StorageUtils.getOwnCacheDirectory(this.getActivity().getApplicationContext(), IMAGE_CACHE_PATH);
    DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder().cacheInMemory(true).cacheOnDisc(true).build();
    ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this.getActivity()).defaultDisplayImageOptions(defaultOptions).memoryCache(new LruMemoryCache(12 * 1024 * 1024)).memoryCacheSize(12 * 1024 * 1024).discCacheSize(32 * 1024 * 1024).discCacheFileCount(100).discCache(new UnlimitedDiscCache(cacheDir)).threadPriority(Thread.NORM_PRIORITY - 2).tasksProcessingOrder(QueueProcessingType.LIFO).build();
    ImageLoader.getInstance().init(config);
}
Also used : UnlimitedDiscCache(com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiscCache) LruMemoryCache(com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache) File(java.io.File) ImageLoaderConfiguration(com.nostra13.universalimageloader.core.ImageLoaderConfiguration) DisplayImageOptions(com.nostra13.universalimageloader.core.DisplayImageOptions)

Example 24 with DisplayImageOptions

use of com.nostra13.universalimageloader.core.DisplayImageOptions in project YourAppIdea by Michenux.

the class YourApplication method onCreate.

@Override
public void onCreate() {
    super.onCreate();
    this.injectSelf();
    // Enable tutorial sync
    this.tutorialSyncHelper.createTutorialAccount(this);
    // Initialize Universal Image Loader
    // Create global configuration and initialize ImageLoader with this configuration
    DisplayImageOptions options = new DisplayImageOptions.Builder().cacheInMemory(// default
    true).cacheOnDisk(// default
    true).displayer(// default SimpleBitmapDisplayer,RoundedBitmapDisplayer(10),FadeInBitmapDisplayer
    new FadeInBitmapDisplayer(5000)).build();
    ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext()).memoryCache(new LruMemoryCache(2 * 1024 * 1024)).memoryCacheSizePercentage(// default
    13).defaultDisplayImageOptions(// default
    options).build();
    ImageLoader.getInstance().init(config);
}
Also used : FadeInBitmapDisplayer(com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer) LruMemoryCache(com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache) ImageLoaderConfiguration(com.nostra13.universalimageloader.core.ImageLoaderConfiguration) DisplayImageOptions(com.nostra13.universalimageloader.core.DisplayImageOptions)

Example 25 with DisplayImageOptions

use of com.nostra13.universalimageloader.core.DisplayImageOptions in project ApertureGallery by MJonesDev.

the class ApertureBasing method onCreate.

@Override
public void onCreate() {
    super.onCreate();
    applicationContext = getApplicationContext();
    applicationHandler = new Handler(applicationContext.getMainLooper());
    checkDisplaySize();
    density = ApertureBasing.applicationContext.getResources().getDisplayMetrics().density;
    DisplayImageOptions defaultDisplayImageOptions = //
    new DisplayImageOptions.Builder().considerExifParams(true).resetViewBeforeLoading(true).showImageOnLoading(R.drawable.nophotos).showImageOnFail(R.drawable.nophotos).delayBeforeLoading(0).build();
    ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext()).defaultDisplayImageOptions(defaultDisplayImageOptions).memoryCacheExtraOptions(480, 800).threadPoolSize(5).build();
    ImageLoader.getInstance().init(config);
}
Also used : Handler(android.os.Handler) ImageLoaderConfiguration(com.nostra13.universalimageloader.core.ImageLoaderConfiguration) DisplayImageOptions(com.nostra13.universalimageloader.core.DisplayImageOptions)

Aggregations

DisplayImageOptions (com.nostra13.universalimageloader.core.DisplayImageOptions)21 ImageLoaderConfiguration (com.nostra13.universalimageloader.core.ImageLoaderConfiguration)15 FadeInBitmapDisplayer (com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer)9 LruMemoryCache (com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache)7 File (java.io.File)7 Bitmap (android.graphics.Bitmap)4 BitmapFactory (android.graphics.BitmapFactory)4 View (android.view.View)4 Md5FileNameGenerator (com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator)4 UnlimitedDiscCache (com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiscCache)3 UnlimitedDiskCache (com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiskCache)3 ImageSize (com.nostra13.universalimageloader.core.assist.ImageSize)3 ActionBar (android.app.ActionBar)2 Tab (android.app.ActionBar.Tab)2 Intent (android.content.Intent)2 SpannableString (android.text.SpannableString)2 TypedValue (android.util.TypedValue)2 ImageView (android.widget.ImageView)2 DBAccessHelper (com.jams.music.player.DBHelpers.DBAccessHelper)2 HashCodeFileNameGenerator (com.nostra13.universalimageloader.cache.disc.naming.HashCodeFileNameGenerator)2