本文整理汇总了Java中com.nostra13.universalimageloader.core.decode.BaseImageDecoder类的典型用法代码示例。如果您正苦于以下问题:Java BaseImageDecoder类的具体用法?Java BaseImageDecoder怎么用?Java BaseImageDecoder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BaseImageDecoder类属于com.nostra13.universalimageloader.core.decode包,在下文中一共展示了BaseImageDecoder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initImageLoader
import com.nostra13.universalimageloader.core.decode.BaseImageDecoder; //导入依赖的package包/类
/**
* 初始化图片载入框架
*/
private void initImageLoader() {
File cacheDir = StorageUtils.getCacheDirectory(this);
int MAXMEMONRY = (int) (Runtime.getRuntime().maxMemory());
// System.out.println("dsa-->"+MAXMEMONRY+" "+(MAXMEMONRY/5));//.memoryCache(new
// LruMemoryCache(50 * 1024 * 1024))
DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder()
.cacheInMemory(true)
.cacheOnDisk(true)
.build();
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(
this).memoryCacheExtraOptions(480, 800).defaultDisplayImageOptions(defaultOptions)
.diskCacheExtraOptions(480, 800, null).threadPoolSize(3)
.threadPriority(Thread.NORM_PRIORITY - 2)
.tasksProcessingOrder(QueueProcessingType.FIFO)
.denyCacheImageMultipleSizesInMemory()
.memoryCache(new LruMemoryCache(MAXMEMONRY / 5))
.diskCache(new UnlimitedDiskCache(cacheDir))
.diskCacheFileNameGenerator(new HashCodeFileNameGenerator()) // default
.imageDownloader(new BaseImageDownloader(this)) // default
.imageDecoder(new BaseImageDecoder(false)) // default
.defaultDisplayImageOptions(DisplayImageOptions.createSimple()).build();
ImageLoader.getInstance().init(config);
}
示例2: initImageLoader
import com.nostra13.universalimageloader.core.decode.BaseImageDecoder; //导入依赖的package包/类
private void initImageLoader(){
Context context = getApplicationContext();
File cacheDir = StorageUtils.getCacheDirectory(context);
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context)
.memoryCacheExtraOptions(480, 800) // default = device screen dimensions
.diskCacheExtraOptions(480, 800, null)
.threadPriority(Thread.NORM_PRIORITY - 2) // default
.tasksProcessingOrder(QueueProcessingType.FIFO) // default
.denyCacheImageMultipleSizesInMemory()
.memoryCache(new LruMemoryCache(2 * 1024 * 1024))
.memoryCacheSize(2 * 1024 * 1024)
.memoryCacheSizePercentage(13) // default
.diskCache(new UnlimitedDiscCache(cacheDir)) // default
.diskCacheSize(50 * 1024 * 1024)
.diskCacheFileCount(100)
.diskCacheFileNameGenerator(new HashCodeFileNameGenerator()) // default
.imageDownloader(new BaseImageDownloader(context)) // default
.imageDecoder(new BaseImageDecoder(false)) // default
.defaultDisplayImageOptions(DisplayImageOptions.createSimple()) // default
// .writeDebugLogs()
.build();
ImageLoader.getInstance().init(config);
}
示例3: getDefaultImageLoaderConfigurationBuilder
import com.nostra13.universalimageloader.core.decode.BaseImageDecoder; //导入依赖的package包/类
public static ImageLoaderConfiguration.Builder getDefaultImageLoaderConfigurationBuilder(Context context) {
File cacheDir = StorageUtils.getCacheDirectory(context);
ImageLoaderConfiguration.Builder builder = new ImageLoaderConfiguration.Builder(context)
// .memoryCacheExtraOptions(480, 800) // default = device screen dimensions
// .discCacheExtraOptions(480, 800, Bitmap.CompressFormat.JPEG, 75, null)
.threadPoolSize(3) // default
.threadPriority(Thread.NORM_PRIORITY - 1) // default
.tasksProcessingOrder(QueueProcessingType.FIFO) // default
.denyCacheImageMultipleSizesInMemory()
// .memoryCache(new LruMemoryCache(2 * 1024 * 1024))
// .memoryCacheSize(2 * 1024 * 1024)
.memoryCacheSizePercentage(13) // default
.discCache(new UnlimitedDiscCache(cacheDir)) // default
// .discCacheSize(50 * 1024 * 1024)
.discCacheFileCount(1000)
.discCacheFileNameGenerator(new HashCodeFileNameGenerator()) // default
.imageDownloader(new BaseImageDownloader(context)) // default
.imageDecoder(new BaseImageDecoder(false)) // default
// .defaultDisplayImageOptions(DisplayImageOptions.createSimple()) // default
.defaultDisplayImageOptions(getDefaultImageOptions());
return builder;
}
示例4: getDefaultImageLoaderConfigurationBuilder
import com.nostra13.universalimageloader.core.decode.BaseImageDecoder; //导入依赖的package包/类
/**
* Get default ImageLoaderConfiguration.Builder,and you can easily change the builder.
* @param context
* @return
*/
public static ImageLoaderConfiguration.Builder getDefaultImageLoaderConfigurationBuilder(Context context) {
File cacheDir = StorageUtils.getCacheDirectory(context);
ImageLoaderConfiguration.Builder builder = new ImageLoaderConfiguration.Builder(context)
// .memoryCacheExtraOptions(480, 800) // default = device screen dimensions
// .discCacheExtraOptions(480, 800, Bitmap.CompressFormat.JPEG, 75, null)
.threadPoolSize(3) // default
.threadPriority(Thread.NORM_PRIORITY - 1) // default
.tasksProcessingOrder(QueueProcessingType.FIFO) // default
.denyCacheImageMultipleSizesInMemory()
// .memoryCache(new LruMemoryCache(2 * 1024 * 1024))
// .memoryCacheSize(2 * 1024 * 1024)
.memoryCacheSizePercentage(13) // default
.diskCache(new UnlimitedDiskCache(cacheDir)) // default
// .discCacheSize(50 * 1024 * 1024)
.diskCacheFileCount(1000)
.diskCacheFileNameGenerator(new HashCodeFileNameGenerator()) // default
.imageDownloader(new BaseImageDownloader(context)) // default
.imageDecoder(new BaseImageDecoder(false)) // default
// .defaultDisplayImageOptions(DisplayImageOptions.createSimple()) // default
.defaultDisplayImageOptions(getDefaultImageOptions());
return builder;
}
示例5: initImageLoader
import com.nostra13.universalimageloader.core.decode.BaseImageDecoder; //导入依赖的package包/类
public static void initImageLoader(Context context) {
File cacheDir = StorageUtils.getCacheDirectory(context);
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context)
.memoryCacheExtraOptions(480, 800) // default = device screen dimensions
.denyCacheImageMultipleSizesInMemory()
.discCacheExtraOptions(480, 800, Bitmap.CompressFormat.JPEG, 75, null)
.threadPriority(Thread.NORM_PRIORITY - 2) // default
.tasksProcessingOrder(QueueProcessingType.FIFO) // default
.denyCacheImageMultipleSizesInMemory()
.memoryCache(new LruMemoryCache(2 * 1024 * 1024))
.memoryCacheSize(2 * 1024 * 1024)
.memoryCacheSizePercentage(13) // default
.discCache(new UnlimitedDiscCache(cacheDir)) // default
.discCacheSize(50 * 1024 * 1024)
.discCacheFileCount(100)
.discCacheFileNameGenerator(new HashCodeFileNameGenerator()) // default
.imageDownloader(new BaseImageDownloader(context)) // default
.imageDecoder(new BaseImageDecoder(true)) // default
.defaultDisplayImageOptions(DisplayImageOptions.createSimple()) // default
.writeDebugLogs()
.build();
ImageLoader.getInstance().init(config);
}
示例6: initImageLoader
import com.nostra13.universalimageloader.core.decode.BaseImageDecoder; //导入依赖的package包/类
/**
* @return void
* @Title: initImageLoader
* @Description: TODO
*/
private void initImageLoader() {
DisplayImageOptions imageOptions = new DisplayImageOptions.Builder()
.showImageOnLoading(R.drawable.default_background)
.showImageOnFail(R.drawable.default_background)
.cacheInMemory(true).cacheOnDisk(true)
.resetViewBeforeLoading(true).considerExifParams(false)
.bitmapConfig(Bitmap.Config.RGB_565).build();
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this)
.memoryCacheExtraOptions(480, 800)
.diskCacheExtraOptions(480, 800, null)
.threadPoolSize(5)
.threadPriority(Thread.NORM_PRIORITY)
.tasksProcessingOrder(QueueProcessingType.LIFO)
.denyCacheImageMultipleSizesInMemory()
.memoryCache(new LruMemoryCache(2 * 1024 * 1024))
.memoryCacheSize(2 * 1024 * 1024)
.memoryCacheSizePercentage(10)
// .diskCache(
// new UnlimitedDiscCache(StorageUtils.getCacheDirectory(
// this, true)))
.diskCacheSize(50 * 1024 * 1024).diskCacheFileCount(100)
.diskCacheFileNameGenerator(new HashCodeFileNameGenerator())
.imageDownloader(new BaseImageDownloader(this))
.imageDecoder(new BaseImageDecoder(false))
.defaultDisplayImageOptions(DisplayImageOptions.createSimple())
.defaultDisplayImageOptions(imageOptions).build();
ImageLoader.getInstance().init(config);
}
示例7: initImageLoader
import com.nostra13.universalimageloader.core.decode.BaseImageDecoder; //导入依赖的package包/类
private void initImageLoader() {
File cacheDir = FileUtil.getCacheDirectory(this, FilePathConfig.PATH_IMAGEDOWNLOADER);
DisplayImageOptions options = new DisplayImageOptions.Builder()
.showImageOnLoading(R.drawable.default_imageview_background) // resource or drawable
.showImageForEmptyUri(R.drawable.default_imageview_background) // resource or drawable
.showImageOnFail(R.drawable.default_imageview_background) // resource or drawable
.resetViewBeforeLoading(false) // default
.delayBeforeLoading(200)
.cacheInMemory(true)
.cacheOnDisk(true)
.imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2) // default
.bitmapConfig(Bitmap.Config.ARGB_8888) // default
.displayer(new SimpleBitmapDisplayer()) // default
.build();
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext())
.memoryCacheExtraOptions(480, 800) // default = device screen dimensions
.diskCacheExtraOptions(480, 800, null)
.threadPoolSize(3) // default
.threadPriority(Thread.NORM_PRIORITY - 2) // default
.tasksProcessingOrder(QueueProcessingType.FIFO) // default
.denyCacheImageMultipleSizesInMemory()
.memoryCache(new LruMemoryCache(20 * 1024 * 1024))
.memoryCacheSize(2 * 1024 * 1024)
.memoryCacheSizePercentage(13) // default
.diskCache(new UnlimitedDiskCache(cacheDir)) // default
.diskCacheSize(50 * 1024 * 1024)
.diskCacheFileCount(100)
.diskCacheFileNameGenerator(new HashCodeFileNameGenerator()) // default
.imageDownloader(new BaseImageDownloader(getApplicationContext())) // default
.imageDecoder(new BaseImageDecoder(false)) // default
.defaultDisplayImageOptions(options)
.build();
ImageLoader.getInstance().init(config);
}
示例8: getLoaderConfig
import com.nostra13.universalimageloader.core.decode.BaseImageDecoder; //导入依赖的package包/类
private ImageLoaderConfiguration getLoaderConfig() {
return new ImageLoaderConfiguration.Builder(this)
.memoryCacheExtraOptions(320, 600)
.threadPoolSize(4)
.threadPriority(Thread.NORM_PRIORITY - 1)
.tasksProcessingOrder(QueueProcessingType.FIFO)
.denyCacheImageMultipleSizesInMemory()
.memoryCache(new LruMemoryCache(20 * 1024 * 1024))
.diskCacheSize(20 * 1024 * 1024)
.diskCacheFileNameGenerator(new Md5FileNameGenerator())
.imageDownloader(new BaseImageDownloader(this))
.imageDecoder(new BaseImageDecoder(true))
.defaultDisplayImageOptions(getOptions())
.build();
}
示例9: initImageLoader
import com.nostra13.universalimageloader.core.decode.BaseImageDecoder; //导入依赖的package包/类
/**
* 初始化ImageLoader
*
* @param context
*/
private static void initImageLoader(Context context) {
if (sConfig != null) {
return;
}
File cacheDir = StorageUtils.getCacheDirectory(context);
sConfig = new ImageLoaderConfiguration.Builder(context)
.memoryCacheExtraOptions(480, 800)
// default = device screen dimensions
.denyCacheImageMultipleSizesInMemory()
.threadPriority(Thread.NORM_PRIORITY - 2)
// default
.tasksProcessingOrder(QueueProcessingType.LIFO)
// default
.denyCacheImageMultipleSizesInMemory()
.memoryCache(new LruMemoryCache(10 * 1024 * 1024))
.memoryCacheSize(10 * 1024 * 1024)
.memoryCacheSizePercentage(13)
.diskCache(new UnlimitedDiskCache(cacheDir))
// default
.diskCacheSize(50 * 1024 * 1024).diskCacheFileCount(100)
.diskCacheFileNameGenerator(new HashCodeFileNameGenerator()) // default
.imageDownloader(new BaseImageDownloader(context)) // default
.imageDecoder(new BaseImageDecoder(true)) // default
.defaultDisplayImageOptions(DisplayImageOptions.createSimple()) // default
.writeDebugLogs().build();
ImageLoader.getInstance().init(sConfig);
}
示例10: initImageLoader
import com.nostra13.universalimageloader.core.decode.BaseImageDecoder; //导入依赖的package包/类
/**
* initial Universal ImageLoader
*
* @param applicationContext
*/
public static void initImageLoader(Context applicationContext) {
File cacheDir = null;
if (FileSystem.available())
cacheDir = StorageUtils.getOwnCacheDirectory(applicationContext, FileSystem.getDirectoryPath(DefaultFileDirectoryContext.FILE_DIRECTORY_TYPE_PICTURE));
else
cacheDir = StorageUtils.getCacheDirectory(applicationContext);
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(applicationContext)
.memoryCacheExtraOptions(480, 800) // default = device screen dimensions
.diskCacheExtraOptions(480, 800, null)
.threadPoolSize(3) // default
.threadPriority(Thread.NORM_PRIORITY - 2) // default
.tasksProcessingOrder(QueueProcessingType.FIFO) // default
.denyCacheImageMultipleSizesInMemory()
.memoryCache(new LruMemoryCache(2 * 1024 * 1024))
.memoryCacheSize(2 * 1024 * 1024)
.memoryCacheSizePercentage(13) // default
.diskCache(new UnlimitedDiscCache(cacheDir)) // default
.diskCacheSize(50 * 1024 * 1024)
.diskCacheFileCount(100)
.diskCacheFileNameGenerator(new HashCodeFileNameGenerator()) // default
.imageDownloader(new BaseImageDownloader(applicationContext)) // default
.imageDecoder(new BaseImageDecoder(true)) // default
.defaultDisplayImageOptions(DisplayImageOptions.createSimple()) // default
.writeDebugLogs()
.build();
ImageLoader.getInstance().init(config);
}
示例11: getImageLoaderConfiguration
import com.nostra13.universalimageloader.core.decode.BaseImageDecoder; //导入依赖的package包/类
public static ImageLoaderConfiguration getImageLoaderConfiguration(Context context) {
final int MEMORY_CACHE_LIMIT = 2 * 1024 * 1024;
final int THREAD_POOL_SIZE = 3;
ImageLoaderConfiguration imageLoaderConfiguration = new ImageLoaderConfiguration.Builder(context)
.threadPoolSize(THREAD_POOL_SIZE).threadPriority(Thread.NORM_PRIORITY)
.denyCacheImageMultipleSizesInMemory()
.memoryCache(new UsingFreqLimitedMemoryCache(MEMORY_CACHE_LIMIT))
.defaultDisplayImageOptions(ImageLoaderUtils.UIL_DEFAULT_DISPLAY_OPTIONS)
.imageDecoder(new SmartUriDecoder(context, new BaseImageDecoder(false)))
.denyCacheImageMultipleSizesInMemory()
.discCacheFileNameGenerator(new HashCodeFileNameGeneratorWithoutToken()).build();
return imageLoaderConfiguration;
}
示例12: SmartUriDecoder
import com.nostra13.universalimageloader.core.decode.BaseImageDecoder; //导入依赖的package包/类
public SmartUriDecoder(Context context, BaseImageDecoder imageUriDecoder) {
if (imageUriDecoder == null) {
throw new NullPointerException("Image decoder can't be null");
}
this.context = new WeakReference(context);
this.imageUriDecoder = imageUriDecoder;
}
示例13: createImageDecoder
import com.nostra13.universalimageloader.core.decode.BaseImageDecoder; //导入依赖的package包/类
/** Creates default implementation of {@link ImageDecoder} - {@link BaseImageDecoder} */
public static ImageDecoder createImageDecoder(boolean loggingEnabled) {
return new BaseImageDecoder(loggingEnabled);
}
示例14: createImageDecoder
import com.nostra13.universalimageloader.core.decode.BaseImageDecoder; //导入依赖的package包/类
public static ImageDecoder createImageDecoder(boolean loggingEnabled) {
return new BaseImageDecoder(loggingEnabled);
}
示例15: ThumbnailDecoder
import com.nostra13.universalimageloader.core.decode.BaseImageDecoder; //导入依赖的package包/类
public ThumbnailDecoder(ContentResolver cr, BaseImageDecoder baseDecoder) {
contentResolver = cr;
baseImageDecoder = baseDecoder;
}