當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。