当前位置: 首页>>代码示例>>Java>>正文


Java ImageLoaderConfiguration.Builder方法代码示例

本文整理汇总了Java中com.nostra13.universalimageloader.core.ImageLoaderConfiguration.Builder方法的典型用法代码示例。如果您正苦于以下问题:Java ImageLoaderConfiguration.Builder方法的具体用法?Java ImageLoaderConfiguration.Builder怎么用?Java ImageLoaderConfiguration.Builder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.nostra13.universalimageloader.core.ImageLoaderConfiguration的用法示例。


在下文中一共展示了ImageLoaderConfiguration.Builder方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initImageLoader

import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; //导入方法依赖的package包/类
public static void initImageLoader(Context context) {
	// This configuration tuning is custom. You can tune every option, you may tune some of them,
	// or you can create default configuration by
	//  ImageLoaderConfiguration.createDefault(this);
	// method.
	ImageLoaderConfiguration.Builder config = new ImageLoaderConfiguration.Builder(context);
	config.threadPriority(Thread.NORM_PRIORITY - 2);
	config.denyCacheImageMultipleSizesInMemory();
	config.diskCacheFileNameGenerator(new Md5FileNameGenerator());
	config.diskCacheSize(50 * 1024 * 1024); // 50 MiB
	config.tasksProcessingOrder(QueueProcessingType.LIFO);
	config.writeDebugLogs(); // Remove for release app

	// Initialize ImageLoader with configuration.
	ImageLoader.getInstance().init(config.build());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:17,代码来源:UILApplication.java

示例2: initImageLoader

import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; //导入方法依赖的package包/类
public static void initImageLoader(Context context) {
    // This configuration tuning is custom. You can tune every option, you may tune some of them,
    // or you can create default configuration by
    //  ImageLoaderConfiguration.createDefault(this);
    // method.
    ImageLoaderConfiguration.Builder config = new ImageLoaderConfiguration.Builder(context);
    config.threadPriority(Thread.NORM_PRIORITY - 2);
    config.denyCacheImageMultipleSizesInMemory();
    config.discCacheFileNameGenerator(new Md5FileNameGenerator());
    config.discCacheSize(50 * 1024 * 1024); // 50 MiB
    config.tasksProcessingOrder(QueueProcessingType.LIFO);
    config.writeDebugLogs(); // Remove for release app

    // Initialize ImageLoader with configuration.
    ImageLoader.getInstance().init(config.build());
  
}
 
开发者ID:fikyair,项目名称:musicplayer,代码行数:18,代码来源:BaseApplication.java

示例3: initImageLoader

import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; //导入方法依赖的package包/类
public static void initImageLoader(Context context) {
    b = new DisplayImageOptions.Builder();
    b.cacheOnDisc(true)
            .cacheInMemory(false)
            .imageScaleType(ImageScaleType.IN_SAMPLE_INT)
            .bitmapConfig(Bitmap.Config.RGB_565);
    ImageLoaderConfiguration.Builder config = new ImageLoaderConfiguration.Builder(context);
    config.threadPriority(Thread.NORM_PRIORITY - 2);
    config.denyCacheImageMultipleSizesInMemory();
    config.discCacheFileNameGenerator(new Md5FileNameGenerator());
    config.memoryCacheSize(20 * 1024 * 1024); // 20 MiB
    config.discCacheSize(100 * 1024 * 1024); // 100 MiB
    config.tasksProcessingOrder(QueueProcessingType.LIFO);
    config.defaultDisplayImageOptions(b.build());
    config.writeDebugLogs();
    ImageLoader.getInstance().init(config.build());
}
 
开发者ID:shenhuanet,项目名称:OpenEyesReading-android,代码行数:18,代码来源:App.java

示例4: initImageLoader

import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; //导入方法依赖的package包/类
private void initImageLoader(Context context) {
    // This configuration tuning is custom. You can tune every option, you may tune some of them,
    // or you can create default configuration by
    //  ImageLoaderConfiguration.createDefault(this);
    // method.
    ImageLoaderConfiguration.Builder config = new ImageLoaderConfiguration.Builder(context);
    config.threadPriority(Thread.NORM_PRIORITY - 2);
    config.denyCacheImageMultipleSizesInMemory();
    config.diskCacheFileNameGenerator(new Md5FileNameGenerator());
    config.diskCacheSize(50 * 1024 * 1024); // 50 MiB
    config.tasksProcessingOrder(QueueProcessingType.LIFO);
    config.writeDebugLogs(); // Remove for release app

    // Initialize ImageLoader with configuration.
    ImageLoader.getInstance().init(config.build());
}
 
开发者ID:YuanPengandy,项目名称:GalleryFinal-master,代码行数:17,代码来源:MainActivity.java

示例5: initImageLoader

import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; //导入方法依赖的package包/类
public static void initImageLoader(Context context) {
        // This configuration tuning is custom. You can tune every option, you may tune some of them,
        // or you can create default configuration by
        //  ImageLoaderConfiguration.createDefault(this);
        // method.
        ImageLoaderConfiguration.Builder config = new ImageLoaderConfiguration.Builder(context);
        config.threadPriority(Thread.NORM_PRIORITY - 4);
//        config.memoryCache(new WeakMemoryCache());
        config.memoryCacheExtraOptions(480, 800);
        config.memoryCacheSize(2 * 1024 * 1024);
        config.denyCacheImageMultipleSizesInMemory();
        config.diskCacheFileNameGenerator(new Md5FileNameGenerator());
        config.diskCacheSize(50 * 1024 * 1024); // 50 MiB
        config.diskCacheExtraOptions(480, 800, null);
        config.tasksProcessingOrder(QueueProcessingType.LIFO);
//        config.writeDebugLogs(); // Remove for release app
        config.imageDownloader(new BaseImageDownloader(context, 5 * 1000, 10 * 1000));
        config.threadPoolSize(1);
        // Initialize ImageLoader with configuration.
        ImageLoader.getInstance().init(config.build());
    }
 
开发者ID:wanliyang1990,项目名称:WliveTV,代码行数:22,代码来源:MyApplication.java

示例6: UILKit

import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; //导入方法依赖的package包/类
/**
 * 初始化
 *
 * @param context
 */
private UILKit(Context context) {
    File cacheDir = getDiskCacheDir(context, "img");

    ImageLoaderConfiguration.Builder config = new ImageLoaderConfiguration.Builder(context)
            .threadPriority(Thread.NORM_PRIORITY - 2)
            .denyCacheImageMultipleSizesInMemory()
            .memoryCacheSize(10 * 1024 * 1024)
            .diskCache(new UnlimitedDiskCache(cacheDir))
            .diskCacheFileNameGenerator(new Md5FileNameGenerator())
            .diskCacheSize(50 * 1024 * 1024) // 50 MiB
            .tasksProcessingOrder(QueueProcessingType.LIFO);

    ImageLoader.getInstance().init(config.build());



    picOptions = new DisplayImageOptions.Builder()
            .imageScaleType(ImageScaleType.EXACTLY)
            .cacheOnDisk(false).cacheInMemory(false)
            .resetViewBeforeLoading(true)
            .displayer(new FadeInBitmapDisplayer(500)).build();
}
 
开发者ID:limedroid,项目名称:XRichText,代码行数:28,代码来源:UILKit.java

示例7: initEbConfig

import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; //导入方法依赖的package包/类
public void initEbConfig(String type) {
	Log4jLog.i(LONG_TAG, "initEbConfig start, type=" + type);
	
	CrashHandler crashHandler = CrashHandler.getInstance();
	crashHandler.init(getApplicationContext());
	
	Log4jLog.i(LONG_TAG, "initEbConfig 1");
	Entboost.setServiceListener(crashHandler);
	Log4jLog.i(LONG_TAG, "initEbConfig 2");
	Entboost.init(getApplicationContext());
	Log4jLog.i(LONG_TAG, "initEbConfig 3");
	Entboost.showSotpLog(false);
	Log4jLog.i(LONG_TAG, "initEbConfig 4");
	
	Builder imgConfig = new ImageLoaderConfiguration.Builder(this);
	imgConfig.threadPriority(Thread.NORM_PRIORITY - 2);// 设置线程的优先级
	imgConfig.diskCacheFileNameGenerator(new Md5FileNameGenerator());// 设置缓存文件的名字
	imgConfig.diskCacheSize(50 * 1024 * 1024); // 50 MiB
	imgConfig.denyCacheImageMultipleSizesInMemory();// 当同一个Uri获取不同大小的图片,缓存到内存时,只缓存一个。默认会缓存多个不同的大小的相同图片
	imgConfig.tasksProcessingOrder(QueueProcessingType.LIFO);// 设置图片下载和显示的工作队列排序
	ImageLoader.getInstance().init(imgConfig.build());
	
	defaultImgOptions = createImgOptions(R.drawable.entboost_logo, R.drawable.entboost_logo, R.drawable.entboost_logo);
	userImgOptions = createImgOptions(0, R.drawable.default_user, R.drawable.default_user);
	funcInfoImgOptions = createImgOptions(0, R.drawable.default_app, R.drawable.default_app);
}
 
开发者ID:entboost,项目名称:EntboostIM,代码行数:27,代码来源:MyApplication.java

示例8: initImageLoader

import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; //导入方法依赖的package包/类
private void initImageLoader(Context context) {
    ImageLoaderConfiguration.Builder config = new ImageLoaderConfiguration.Builder(context);
    config.denyCacheImageMultipleSizesInMemory();
    config.diskCacheSize(50 * 1024 * 1024);
    config.tasksProcessingOrder(QueueProcessingType.LIFO);
    ImageLoader.getInstance().init(config.build());

    defaultOptions = new DisplayImageOptions.Builder()
            .cacheInMemory(false)
            .cacheOnDisk(true)
            .imageScaleType(ImageScaleType.IN_SAMPLE_INT)//设置图片以如何的编码方式显示
            .showImageOnLoading(R.mipmap.loading)
            .bitmapConfig(Bitmap.Config.RGB_565)
            .showImageOnFail(R.mipmap.loading)
            .showImageForEmptyUri(R.mipmap.loading)
            .build();

    ImageLoader.getInstance().clearDiskCache();
    ImageLoader.getInstance().clearMemoryCache();
}
 
开发者ID:yingLanNull,项目名称:ImageLoadingView,代码行数:21,代码来源:MyApp.java

示例9: initImageLoader

import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; //导入方法依赖的package包/类
public static void initImageLoader(Context context) {
    ImageLoaderConfiguration.Builder config = new ImageLoaderConfiguration.Builder(context);
    config.threadPriority(Thread.NORM_PRIORITY - 2);
    config.denyCacheImageMultipleSizesInMemory();
    config.diskCacheFileNameGenerator(new Md5FileNameGenerator());
    config.diskCacheSize(50 * 1024 * 1024); // 50 MiB
    config.tasksProcessingOrder(QueueProcessingType.LIFO);
    config.writeDebugLogs(); // Remove for release app

    // Initialize ImageLoader with configuration.
    ImageLoader.getInstance().init(config.build());
}
 
开发者ID:dibakarece,项目名称:DMAudioStreamer,代码行数:13,代码来源:AudioStreamerApplication.java

示例10: initImageLoader

import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; //导入方法依赖的package包/类
public static void initImageLoader(Context context) {

        ImageLoaderConfiguration.Builder config = new ImageLoaderConfiguration.Builder(context);
        config.threadPriority(Thread.NORM_PRIORITY - 2);
        config.denyCacheImageMultipleSizesInMemory();
        config.diskCacheFileNameGenerator(new Md5FileNameGenerator());
        config.diskCacheSize(50 * 1024 * 1024); // 50 MiB
        config.tasksProcessingOrder(QueueProcessingType.LIFO);
        //config.writeDebugLogs(); // Remove for release app
        ImageLoader.getInstance().init(config.build());
    }
 
开发者ID:AppHero2,项目名称:Raffler-Android,代码行数:12,代码来源:AppApplication.java

示例11: initImageLoader

import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; //导入方法依赖的package包/类
private void initImageLoader(Context context) {

        DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder()
                //.showImageForEmptyUri(R.drawable.ic_empty)
                //.showImageOnFail(R.drawable.ic_error)
                .resetViewBeforeLoading(true)
                .cacheInMemory(true)
                .cacheOnDisk(true)
                .imageScaleType(ImageScaleType.EXACTLY)
                .bitmapConfig(Bitmap.Config.RGB_565)
                .considerExifParams(true)
                .displayer(new FadeInBitmapDisplayer(300))
                .build();

        // This configuration tuning is custom. You can tune every option, you may tune some of them,
        // or you can create default configuration by
        //  ImageLoaderConfiguration.createDefault(this);
        // method.
        ImageLoaderConfiguration.Builder config = new ImageLoaderConfiguration.Builder(context);
        config.threadPriority(Thread.NORM_PRIORITY - 2);
        config.denyCacheImageMultipleSizesInMemory();
        config.diskCacheFileNameGenerator(new Md5FileNameGenerator());
        config.diskCacheSize(50 * 1024 * 1024); // 50 MiB
        config.tasksProcessingOrder(QueueProcessingType.LIFO);
        config.defaultDisplayImageOptions(defaultOptions);

        // Initialize ImageLoader with configuration.
        ImageLoader.getInstance().init(config.build());

    }
 
开发者ID:cowthan,项目名称:AyoRxJava,代码行数:31,代码来源:App.java

示例12: initImageLoader

import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; //导入方法依赖的package包/类
private void initImageLoader()
{
	final String CACHE_DIR = App.getWorkingDirectory() + File.separator + ".temp";
	File file = new File(CACHE_DIR);
	if(!file.exists())
		file.mkdirs();
	
	try
	{
		File cacheDir = StorageUtils.getOwnCacheDirectory(getBaseContext(), CACHE_DIR);

		DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder().cacheOnDisc(true)
				.imageScaleType(ImageScaleType.EXACTLY).bitmapConfig(Bitmap.Config.RGB_565).build();
		ImageLoaderConfiguration.Builder builder = new ImageLoaderConfiguration.Builder(getBaseContext())
				.defaultDisplayImageOptions(defaultOptions).discCache(new UnlimitedDiskCache(cacheDir))
				.memoryCache(new WeakMemoryCache());

		ImageLoaderConfiguration config = builder.build();
		imageLoader = ImageLoader.getInstance();
		imageLoader.init(config);

	}
	catch(Exception e)
	{
		e.printStackTrace();
	}
}
 
开发者ID:KAlO2,项目名称:PerfectShow,代码行数:28,代码来源:GalleryActivity.java

示例13: initImageLoader

import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; //导入方法依赖的package包/类
public static void initImageLoader(Context context) {
    ImageLoaderConfiguration.Builder config = new ImageLoaderConfiguration.Builder(context);
    config.threadPriority(Thread.NORM_PRIORITY);
    config.denyCacheImageMultipleSizesInMemory();
    config.memoryCacheSize((int) Runtime.getRuntime().maxMemory() / 4);
    config.diskCacheFileNameGenerator(new Md5FileNameGenerator());
    config.diskCacheSize(100 * 1024 * 1024); // 100 MiB
    config.tasksProcessingOrder(QueueProcessingType.LIFO);
    //修改连接超时时间5秒,下载超时时间5秒
    config.imageDownloader(new BaseImageDownloader(appContext, 5 * 1000, 5 * 1000));
    //		config.writeDebugLogs(); // Remove for release app
    // Initialize ImageLoader with configuration.
    ImageLoader.getInstance().init(config.build());
}
 
开发者ID:giantss,项目名称:com.giants.multiimagespicker,代码行数:15,代码来源:AppContext.java

示例14: initImageLoader

import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; //导入方法依赖的package包/类
private static void initImageLoader() {
    // This configuration tuning is custom. You can tune every option, you may tune some of them,
    // or you can create default configuration by
    // ImageLoaderConfiguration.createDefault(this);
    // method.
    ImageLoaderConfiguration.Builder config = new ImageLoaderConfiguration.Builder(mApplicationContext);

    config.threadPriority(Thread.NORM_PRIORITY - 2);
    config.denyCacheImageMultipleSizesInMemory();
    config.diskCacheFileNameGenerator(new Md5FileNameGenerator());
    config.diskCacheSize(50 * 1024 * 1024); // 50 MiB
    config.tasksProcessingOrder(QueueProcessingType.LIFO);

    if (Debug.SHOW_DEVELOP_LOG) {
        // Remove for release app
        config.writeDebugLogs();
    }

    // Initialize ImageLoader with configuration.
    ImageLoader.getInstance().init(config.build());

    // ************** How to use **************
    // "http://site.com/image.png" // from Web
    // "file:///mnt/sdcard/image.png" // from SD card
    // "file:///mnt/sdcard/video.mp4" // from SD card (video thumbnail)
    // "content://media/external/images/media/13" // from content provider
    // "content://media/external/video/media/13" // from content provider (video thumbnail)
    // "assets://image.png" // from assets
    // "drawable://" + R.drawable.img // from drawables (non-9patch images)
    //
    // ImageLoader.getInstance().displayImage("uri", (ImageAware) null);
}
 
开发者ID:imknown,项目名称:IMKBaseFrameworkLibrary,代码行数:33,代码来源:BaseApplication.java

示例15: initImageLoader

import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; //导入方法依赖的package包/类
public static void initImageLoader(Context context) {
    ImageLoaderConfiguration.Builder build = new ImageLoaderConfiguration.Builder(context);
    build.tasksProcessingOrder(QueueProcessingType.LIFO);
    build.diskCacheSize(MAX_DISK_CACHE);
    build.memoryCacheSize(MAX_MEMORY_CACHE);
    build.memoryCache(new LruMemoryCache(MAX_MEMORY_CACHE));

    if (BuildConfig.DEBUG && isShowLog) {
        build.writeDebugLogs();
    }
    getImageLoader().init(build.build());
}
 
开发者ID:niuzehai,项目名称:Sxumiro_AndroidClient,代码行数:13,代码来源:ImageLoadProxy.java


注:本文中的com.nostra13.universalimageloader.core.ImageLoaderConfiguration.Builder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。