本文整理匯總了Java中com.android.volley.toolbox.ImageLoader.getImageListener方法的典型用法代碼示例。如果您正苦於以下問題:Java ImageLoader.getImageListener方法的具體用法?Java ImageLoader.getImageListener怎麽用?Java ImageLoader.getImageListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.android.volley.toolbox.ImageLoader
的用法示例。
在下文中一共展示了ImageLoader.getImageListener方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: bindLvData
import com.android.volley.toolbox.ImageLoader; //導入方法依賴的package包/類
@AfterViews
public void bindLvData(){
moduleBeans=DataUtils.getAdapterData();
if(mAdapter==null) {
mAdapter = new QuickAdapter<ModuleBean>(this, R.layout.lv_item_base_layout,moduleBeans) {
@Override
protected void convert(BaseAdapterHelper helper, ModuleBean item) {
//列表底下顯示進度
mAdapter.showIndeterminateProgress(true);
helper.setText(R.id.text_lv_item_title, item.getModulename())
.setText(R.id.text_lv_item_description, item.getDescription());
//setImageUrl(R.id.img_lv_item, item.getImgurl());
//使用ImageLoader進行加載圖片
ImageView loader_img=helper.getView(R.id.img_lv_item);
listener=ImageLoader.getImageListener(loader_img,R.drawable.ic_loading,R.drawable.ic_loading);
imageLoader.get(item.getImgurl(),listener);
}
};
lv_base_adapter.setAdapter(mAdapter);
}
}
示例2: getView
import com.android.volley.toolbox.ImageLoader; //導入方法依賴的package包/類
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
ViewHolder holder = null;
if (view == null) {
view = LayoutInflater.from(mContext).inflate(R.layout.posts_listview_item, null);
holder = new ViewHolder();
holder.imb_icon = (ImageButton) view.findViewById(R.id.id_imb_user_icon);
holder.username = (TextView) view.findViewById(R.id.id_post_username);
holder.time = (TextView) view.findViewById(R.id.id_post_date);
holder.comment = (TextView) view.findViewById(R.id.id_tv_post_reply_content);
holder.floor = (TextView) view.findViewById(R.id.id_tv_reply_floor);
holder.title = (TextView) view.findViewById(R.id.id_tv_post_title);
view.setTag(holder);
} else {
holder = (ViewHolder) view.getTag();
}
StringBuilder sb= new StringBuilder();
sb.append(i+1).append("#");
holder.floor.setText(sb.toString());
PostBitsBean bean = list.get(i);
if (i == 0) {
holder.title.setVisibility(View.VISIBLE);
holder.title.setText(bean.getTitle());
} else {
holder.title.setVisibility(View.GONE);
}
holder.username.setText(bean.getUsername());
holder.comment.setText(Html.fromHtml(bean.getMessage()));
holder.time.setText(bean.getPostdate() + " " + bean.getPosttime());
int userid = bean.getUserid();
if(bean.getAvatar()==1){
ImageLoader.ImageListener listener = ImageLoader.getImageListener(holder.imb_icon, R.mipmap.user_default_icon, R.mipmap.user_default_icon);
mImageLoad.get(AppConstants.USER_ICON_PATH+userid,listener);
}else{
holder.imb_icon.setBackgroundResource(R.mipmap.user_default_icon);
}
return view;
}
示例3: send
import com.android.volley.toolbox.ImageLoader; //導入方法依賴的package包/類
public static void send(ImageView iv, String resId, int maxWidth, int maxHeight) {
ImageLoader.ImageListener imageListener = ImageLoader.getImageListener(iv,
R.mipmap.pic_load_wait, R.mipmap.pic_load_failed);
String url = getPictureUrl(resId);
imageLoader.get(url, imageListener, maxWidth, maxHeight);
LogUtil.log("GET PIC => " + url);
}
示例4: getBitmap
import com.android.volley.toolbox.ImageLoader; //導入方法依賴的package包/類
private void getBitmap(final String url, ImageView imageView, int maxWidth,
int maxHeight, ScaleType scaleType, int defaultLoadingBitmapResId,
int defaultErrorBitmapResId, ImageListener listener,
ClippingBitmapListener clippingBitmapListener) {
LarkImageLoader imageLoader = new LarkImageLoader(mRequestQueue,
BitmapImageCache.getInstance());
if (clippingBitmapListener != null) {
imageLoader.setClippingBitmapListener(clippingBitmapListener);
}
ImageListener imageListener = null;
if (listener != null) {
imageListener = listener;
} else {
if (imageView != null) {
imageListener = ImageLoader.getImageListener(imageView,
defaultLoadingBitmapResId, defaultErrorBitmapResId);
} else {
Log.e(TAG,
"Invalid request(No ImageListener and ImageView).Url:"
+ url);
}
}
if(scaleType == null){
scaleType = ScaleType.CENTER_INSIDE;
}
imageLoader.get(url, imageListener, maxWidth, maxHeight, scaleType);
}
示例5: disPlayImage
import com.android.volley.toolbox.ImageLoader; //導入方法依賴的package包/類
public static void disPlayImage(Context context, ImageView imageView,
String url, int defaultResourceId, int errorResourceId) {
ImageListener listener = ImageLoader.getImageListener(imageView,
defaultResourceId, errorResourceId);
getImageLoader(context).get(url, listener);
}
示例6: loadImage
import com.android.volley.toolbox.ImageLoader; //導入方法依賴的package包/類
/**
* 限製圖片的寬高,如果w,h的參數為0,則不壓縮
* @param imageView
* @param url
* @param w
* @param h
*/
public static void loadImage(ImageView imageView, String url,int w,int h) {
ImageLoader.ImageListener listener = ImageLoader.getImageListener(imageView,
R.drawable.default_avatar_ori, R.drawable.default_avatar_ori);
ImageLoader imageLoader = new ImageLoader(queue, new BitmapCache());
if (w<=0||h<=0){
imageLoader.get(url, listener);
}else{
imageLoader.get(url, listener,w,h);
}
}
示例7: get_imageloader
import com.android.volley.toolbox.ImageLoader; //導入方法依賴的package包/類
private void get_imageloader()
{
textview.setText("獲取圖片開始了");
networkImageView.setImageBitmap(null);
imageView.setImageBitmap(null);
String url = "http://g.hiphotos.baidu.com/image/pic/item/21a4462309f790521631d9e908f3d7ca7bcbd53f.jpg";
ImageLoader loader = new ImageLoader(MyApplication.getHttpQueues(), new BitmapCache());
ImageLoader.ImageListener listener = ImageLoader.getImageListener(imageView, R.drawable.default_icon , R.drawable.error );
loader.get(url, listener);
}
示例8: getImage
import com.android.volley.toolbox.ImageLoader; //導入方法依賴的package包/類
public static void getImage(String imgUrl, ImageView view) {
initRequestQueue();
ImageLoader imageLoader = new ImageLoader(mRequestQueue, new BitmapCache());
ImageLoader.ImageListener listener = ImageLoader.getImageListener(view, R.mipmap.loading, R.mipmap.email);
imageLoader.get(imgUrl,listener);
}
示例9: getUserPhoto
import com.android.volley.toolbox.ImageLoader; //導入方法依賴的package包/類
public static void getUserPhoto(String imgUrl, ImageView view) {
initRequestQueue();
ImageLoader imageLoader = new ImageLoader(mRequestQueue, new BitmapCache());
ImageLoader.ImageListener listener = ImageLoader.getImageListener(view, R.mipmap.profile_picture, R.mipmap.profile_picture);
imageLoader.get(imgUrl,listener);
}
示例10: UseImageLoader
import com.android.volley.toolbox.ImageLoader; //導入方法依賴的package包/類
private void UseImageLoader() {
ImageLoader imageLoader = new ImageLoader(mQueue, new BitmapCache());
ImageLoader.ImageListener listener = ImageLoader.getImageListener(iv_image, R.drawable.ico_default, R.drawable.ico_default);
imageLoader.get("http://img.my.csdn.net/uploads/201603/26/1458988468_5804.jpg", listener);
}
示例11: getImage
import com.android.volley.toolbox.ImageLoader; //導入方法依賴的package包/類
public void getImage(ImageView imageView, String url) {
ImageLoader imageLoader = new ImageLoader(mRequestQueue, new BitmapCache());
ImageLoader.ImageListener listener = ImageLoader.getImageListener(imageView,
R.drawable.default_picture, R.drawable.default_picture);
imageLoader.get(url, listener);
}
示例12: getView
import com.android.volley.toolbox.ImageLoader; //導入方法依賴的package包/類
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
ViewHolder holder;
if (view == null) {
view = LayoutInflater.from(mContext).inflate(R.layout.forum_listview_item, null);
holder = new ViewHolder();
holder.imv = (ImageView) view.findViewById(R.id.id_imv_user_icon);
holder.title = (TextView) view.findViewById(R.id.id_tv_title);
holder.readCount = (TextView) view.findViewById(R.id.id_tv_readNum);
holder.replyCount = (TextView) view.findViewById(R.id.id_tv_replyNum);
holder.username = (TextView) view.findViewById(R.id.id_tv_threadusername);
view.setTag(holder);
} else {
holder = (ViewHolder) view.getTag();
}
ThreadBean bean = list.get(i);
if (bean != null) {
String title = bean.getThreadtitle();
if (AppConstants.NEW_FORUM_ID != threadType) {
if (AppConstants.GLOBLE_TOP_FORUM == bean.getGlobalsticky()) {
title = "<font color=\"red\">【總頂】</font>" + bean.getThreadtitle();
} else if (AppConstants.TOP_FORUM == bean.getSticky()) {
title = "<font color=\"red\">【置頂】</font>" + bean.getThreadtitle();
}
}
if (bean.getAvatar() == 0) {
holder.imv.setBackgroundResource(R.mipmap.nopic);
} else if (bean.getAvatar() == 1) {
int userId = bean.getPostuserid();
ImageLoader.ImageListener listener = ImageLoader.getImageListener(holder.imv, R.mipmap.nopic, R.mipmap.nopic);
imageLoader.get(AppConstants.USER_ICON_PATH + userId, listener);
}
holder.title.setText(Html.fromHtml(title));
holder.replyCount.setText(bean.getReplycount() + "");
holder.readCount.setText(bean.getViews() + "");
holder.username.setText(bean.getPostusername());
}
return view;
}