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


Java ImageLoader.getImageListener方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:22,代码来源:VolleyLoaderActivity.java

示例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;
}
 
开发者ID:bianwl,项目名称:kanxue,代码行数:41,代码来源:PostReplyAdapter.java

示例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);
}
 
开发者ID:sczyh30,项目名称:yuedong-app,代码行数:8,代码来源:BitmapRequestClient.java

示例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);
}
 
开发者ID:814042432,项目名称:lark,代码行数:29,代码来源:LarkImageLoaderUtil.java

示例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);

}
 
开发者ID:GankLun,项目名称:VolleyUtils,代码行数:8,代码来源:VolleyUtil.java

示例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);
    }
}
 
开发者ID:chenjunqian,项目名称:here,代码行数:20,代码来源:HttpRequest.java

示例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);

}
 
开发者ID:Tim9Liu9,项目名称:volley_demo,代码行数:14,代码来源:ImagesActivity.java

示例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);
}
 
开发者ID:ligongzai,项目名称:QianXun,代码行数:7,代码来源:RequestManager.java

示例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);
}
 
开发者ID:ligongzai,项目名称:QianXun,代码行数:7,代码来源:RequestManager.java

示例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);
}
 
开发者ID:henrymorgen,项目名称:android-advanced-light,代码行数:6,代码来源:MainActivity.java

示例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);
}
 
开发者ID:yuchenfw,项目名称:QuickNews,代码行数:7,代码来源:NewsAdapter.java

示例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;
}
 
开发者ID:bianwl,项目名称:kanxue,代码行数:42,代码来源:ThreadAdapter.java


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