AndBase开发框架  1.5.8r3
 全部  命名空间 文件 函数 变量 枚举值 
Public 成员函数 | 静态 Public 成员函数 | 静态 Public 属性 | Private 属性 | 静态 Private 属性 | 所有成员列表
com.ab.bitmap.AbImageDownloader类 参考

Public 成员函数

 AbImageDownloader (Context context)
 
Bitmap display (final ImageView imageView, String url)
 
void execute (final AbImageDownloadItem item)
 
void setLoadingImage (int resID)
 
void setLoadingView (View view)
 
void setErrorImage (int resID)
 
void setNoImage (int resID)
 
int getWidth ()
 
void setWidth (int width)
 
int getHeight ()
 
void setHeight (int height)
 
int getType ()
 
void setType (int type)
 

静态 Public 成员函数

static AbImageDownloader newInstance (Context context)
 

静态 Public 属性

static Executor mExecutorService = null
 

Private 属性

Context mContext = null
 
int width
 
int height
 
int type = AbImageUtil.ORIGINALIMG
 
Drawable loadingImage
 
View loadingView
 
Drawable errorImage
 
Drawable noImage
 

静态 Private 属性

static Handler handler
 

详细描述

© 2012 amsoft.cn 名称:AbImageDownloader.java 描述:下载图片并显示的工具类.

作者
还如一梦中
版本
v1.0
日期
:2011-12-10 上午10:10:53

构造及析构函数说明

com.ab.bitmap.AbImageDownloader.AbImageDownloader ( Context  context)
inline

构造图片下载器.

参数
contextthe context

成员函数说明

Bitmap com.ab.bitmap.AbImageDownloader.display ( final ImageView  imageView,
String  url 
)
inline

显示这个图片,解决了列表问题. 列表问题:滑动过程中,getView的imageView会重复利用,导致图片会串位

参数
imageView显得的View
urlthe url
void com.ab.bitmap.AbImageDownloader.execute ( final AbImageDownloadItem  item)
inline

执行下载.

参数
itemthe item
int com.ab.bitmap.AbImageDownloader.getHeight ( )
inline

获取图片的高度.

返回
the height
int com.ab.bitmap.AbImageDownloader.getType ( )
inline

获取图片处理类型.

返回
the type
int com.ab.bitmap.AbImageDownloader.getWidth ( )
inline

获取图片宽度.

返回
the width
static AbImageDownloader com.ab.bitmap.AbImageDownloader.newInstance ( Context  context)
inlinestatic

New instance.

参数
contextthe context
返回
the ab image downloader
void com.ab.bitmap.AbImageDownloader.setErrorImage ( int  resID)
inline

描述:设置下载失败的图片.

参数
resIDthe new error image
void com.ab.bitmap.AbImageDownloader.setHeight ( int  height)
inline

描述:设置图片的高度.

参数
heightthe new height
void com.ab.bitmap.AbImageDownloader.setLoadingImage ( int  resID)
inline

描述:设置下载中的图片.

参数
resIDthe new loading image
void com.ab.bitmap.AbImageDownloader.setLoadingView ( View  view)
inline

描述:设置下载中的View,优先级高于setLoadingImage.

参数
view放在ImageView的上边或者下边的View
void com.ab.bitmap.AbImageDownloader.setNoImage ( int  resID)
inline

描述:设置未找到的图片.

参数
resIDthe new no image
void com.ab.bitmap.AbImageDownloader.setType ( int  type)
inline

描述:图片的处理类型(剪切或者缩放到指定大小,参考AbConstant类).

参数
typethe new type
void com.ab.bitmap.AbImageDownloader.setWidth ( int  width)
inline

描述:设置图片的宽度.

参数
widththe new width

类成员变量说明

Drawable com.ab.bitmap.AbImageDownloader.errorImage
private

显示下载失败的图片.

Handler com.ab.bitmap.AbImageDownloader.handler
staticprivate
初始值:
= new Handler() {
@Override
public void handleMessage(Message msg) {
AbImageDownloadItem item = (AbImageDownloadItem)msg.obj;
item.getListener().update(item.bitmap, item.imageUrl);
}
}

下载完成后的消息句柄.

int com.ab.bitmap.AbImageDownloader.height
private

显示的图片的高.

Drawable com.ab.bitmap.AbImageDownloader.loadingImage
private

显示为下载中的图片.

View com.ab.bitmap.AbImageDownloader.loadingView
private

显示为下载中的View.

Context com.ab.bitmap.AbImageDownloader.mContext = null
private

Context.

Executor com.ab.bitmap.AbImageDownloader.mExecutorService = null
static

线程执行器.

Drawable com.ab.bitmap.AbImageDownloader.noImage
private

图片未找到的图片.

int com.ab.bitmap.AbImageDownloader.type = AbImageUtil.ORIGINALIMG
private

图片的处理类型(剪切或者缩放到指定大小).

int com.ab.bitmap.AbImageDownloader.width
private

显示的图片的宽.


该类的文档由以下文件生成: