本文整理汇总了Java中com.nostra13.universalimageloader.core.display.BitmapDisplayer类的典型用法代码示例。如果您正苦于以下问题:Java BitmapDisplayer类的具体用法?Java BitmapDisplayer怎么用?Java BitmapDisplayer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BitmapDisplayer类属于com.nostra13.universalimageloader.core.display包,在下文中一共展示了BitmapDisplayer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: XBitmapOptions
import com.nostra13.universalimageloader.core.display.BitmapDisplayer; //导入依赖的package包/类
private XBitmapOptions(int iamgeDefault,BitmapDisplayer bitmapDisplayer) {
this.iamgeDefault = iamgeDefault;
this.imageResOnLoading = iamgeDefault;
this.imageResForEmptyUri = iamgeDefault;
this.imageResOnFail = iamgeDefault;
this.bitmapDisplayer = bitmapDisplayer;
}
示例2: loadRoundBorderImage
import com.nostra13.universalimageloader.core.display.BitmapDisplayer; //导入依赖的package包/类
/**
*
* @param url
* @param pic
* @param radius 不需要缩放
* @param borderColor
* @param borderWidth 不需要缩放
*/
public void loadRoundBorderImage(String url, ImageView pic,int defaultImg, int radius, int borderColor, int borderWidth) {
url = resizeUrl(pic, url);
if (isLoad(pic,url)) {
DisplayImageOptions options = BitmapOptions.getRoundBorderOpt(0, ScreenUtil.getScalePxValue(radius), borderColor, ScreenUtil.getScalePxValue(borderWidth));
BitmapDisplayer displayer = options.getDisplayer();
ImageLoader.getInstance().displayImage(url, pic,options,getRounderImageLoaderListener(displayer,defaultImg));
}
}
示例3: ImageLoadingInfo
import com.nostra13.universalimageloader.core.display.BitmapDisplayer; //导入依赖的package包/类
public ImageLoadingInfo(String uri, ImageAware imageAware, ImageSize targetSize, String memoryCacheKey,
DisplayImageOptions options, ImageLoadingListener listener,
ImageLoadingProgressListener progressListener, ReentrantLock loadFromUriLock) {
this.uri = uri;
this.imageAware = imageAware;
this.targetSize = targetSize;
this.options = options;
this.listener = listener;
this.progressListener = progressListener;
this.loadFromUriLock = loadFromUriLock;
this.memoryCacheKey = memoryCacheKey;
mFileTypeStatus = BitmapDisplayer.FILE_TYPE_UNDEFINE;
mFilePath = null;
}
示例4: constructDisplayOption
import com.nostra13.universalimageloader.core.display.BitmapDisplayer; //导入依赖的package包/类
/**
* 构造图片显示的配置选项
*
* @param placeHolderImgRes 默认的占位显示图片
* @param emptyUrlImgRes 空链接显示的图片
* @param failedImgRes 加载失败显示的图片
* @param cacheInMemory 是否内存缓存,图片过大,建议不要内存缓存
* @return
*/
private static DisplayImageOptions constructDisplayOption(String url, int placeHolderImgRes, int emptyUrlImgRes,
int failedImgRes, boolean cacheInMemory, BitmapDisplayer displayer) {
DisplayImageOptions.Builder bulider = new DisplayImageOptions.Builder();
bulider.cacheOnDisc(true); // 默认开启磁盘缓存 缓存在默认位置
// /sdcard/Android/data/[package_name]/cache
bulider.cacheInMemory(cacheInMemory);
bulider.resetViewBeforeLoading(true);
bulider.bitmapConfig(Bitmap.Config.RGB_565);
// bulider.displayer(new FadeInBitmapDisplayer(200));//加载动画
if (displayer != null) {
bulider.displayer(displayer);
}
if (placeHolderImgRes > 0) {
bulider.showStubImage(placeHolderImgRes);
}
if (emptyUrlImgRes > 0) {
bulider.showImageForEmptyUri(emptyUrlImgRes);
}
if (failedImgRes > 0) {
bulider.showImageOnFail(failedImgRes);
}
return bulider.build();
}
示例5: loadImage
import com.nostra13.universalimageloader.core.display.BitmapDisplayer; //导入依赖的package包/类
/**
* 加载显示图片
*
* @param imageView 显示图片的组件
* @param url 图片加载的URL
* @param placeHolderImg 默认的占位显示图片
* @param emptyUrlImgRes 空链接显示的图片,不定义请置 0
* @param failedImgRes 加载失败显示的图片,不定义请置 0
* @param cacheInMemory 是否将图片缓存到内存中 (大图不建议缓存到内存中)
*/
public static void loadImage(ImageView imageView, String url, int placeHolderImg, int emptyUrlImgRes,
int failedImgRes, boolean cacheInMemory, BitmapDisplayer displayer) {
DisplayImageOptions option = constructDisplayOption(url, placeHolderImg, emptyUrlImgRes, failedImgRes,
cacheInMemory, displayer);
if (Strings.isEmpty(url)
|| (!url.endsWith(".jpg") && !url.endsWith(".jpeg") && !url.endsWith(".png") && !url.endsWith(".JPG")
&& !url.endsWith(".JPEG") && !url.endsWith(".PNG"))) {
if (placeHolderImg != 0) {
imageView.setImageResource(placeHolderImg);
}
return;
}
imageLoader.displayImage(url, imageView, option);
}
示例6: displayer
import com.nostra13.universalimageloader.core.display.BitmapDisplayer; //导入依赖的package包/类
public Builder displayer(BitmapDisplayer bitmapdisplayer)
{
if (bitmapdisplayer == null)
{
throw new IllegalArgumentException("displayer can't be null");
} else
{
q = bitmapdisplayer;
return this;
}
}
示例7: getDisplayer
import com.nostra13.universalimageloader.core.display.BitmapDisplayer; //导入依赖的package包/类
public BitmapDisplayer getDisplayer() {
return displayer;
}
示例8: createBitmapDisplayer
import com.nostra13.universalimageloader.core.display.BitmapDisplayer; //导入依赖的package包/类
/** Creates default implementation of {@link BitmapDisplayer} - {@link SimpleBitmapDisplayer} */
public static BitmapDisplayer createBitmapDisplayer() {
return new SimpleBitmapDisplayer();
}
示例9: getDisplayer
import com.nostra13.universalimageloader.core.display.BitmapDisplayer; //导入依赖的package包/类
public BitmapDisplayer getDisplayer() {
return this.displayer;
}
示例10: createBitmapDisplayer
import com.nostra13.universalimageloader.core.display.BitmapDisplayer; //导入依赖的package包/类
public static BitmapDisplayer createBitmapDisplayer() {
return new SimpleBitmapDisplayer();
}
示例11: getDisplayer
import com.nostra13.universalimageloader.core.display.BitmapDisplayer; //导入依赖的package包/类
private BitmapDisplayer getDisplayer() {
if (VERSION.SDK_INT >= 9) {
return new FadeInBitmapDisplayer(200);
}
return new SimpleBitmapDisplayer();
}
示例12: getNewInstance
import com.nostra13.universalimageloader.core.display.BitmapDisplayer; //导入依赖的package包/类
public static XBitmapOptions getNewInstance(int iamgeDefault,BitmapDisplayer bitmapDisplayer) {
return new XBitmapOptions(iamgeDefault,bitmapDisplayer);
}
示例13: getBitmapDisplayer
import com.nostra13.universalimageloader.core.display.BitmapDisplayer; //导入依赖的package包/类
public BitmapDisplayer getBitmapDisplayer() {
return bitmapDisplayer;
}
示例14: showImage
import com.nostra13.universalimageloader.core.display.BitmapDisplayer; //导入依赖的package包/类
/**
* @param view
* @param status 1-->loading 2-->failed
*/
private void showImage(View view, int status) {
try {
if (view != null && view instanceof ImageView) {
boolean isShow = false;
switch (status) {
case 1:
isShow = options.checkImageResOnLoading();
break;
case 2:
isShow = options.checkImageResOnFail();
break;
}
if (isShow) {
Context context = view.getContext();
//得到Resources对象
Resources r = context.getResources();
Bitmap bmp = null;
if (status == 1) {
bmp = BitmapFactory.decodeResource(r, options.getImageResOnLoading());
} else if (status == 2){
bmp = BitmapFactory.decodeResource(r, options.getImageResOnFail());
}
Drawable drawable = null;
if (bmp != null) {
switch (type) {
case 0:
// drawable = new BitmapDrawable(bmp);
break;
case 1:
drawable = new CircleDrawable(bmp);
break;
case 2:
BitmapDisplayer bitmapDisplayer = options.getBitmapDisplayer();
if (bitmapDisplayer!=null&& bitmapDisplayer instanceof RoundBorderBitmapDisplayer)
drawable = ((RoundBorderBitmapDisplayer) bitmapDisplayer).getImageDrawable(new ImageViewAware((ImageView) view), bmp);
break;
}
}
if (drawable != null) {
((ImageView) view).setImageDrawable(drawable);
} else {
if (bmp != null) {
((ImageView) view).setImageBitmap(bmp);
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
示例15: getRounderImageLoaderListener
import com.nostra13.universalimageloader.core.display.BitmapDisplayer; //导入依赖的package包/类
private XImageLoaderListener getRounderImageLoaderListener(BitmapDisplayer displayer,int defaultImageRes) {
return XImageLoaderListener.getNewInstance(2,XBitmapOptions.getNewInstance(defaultImageRes,displayer));
}