Java 类com.android.volley.Response.Listener 实例源码

项目:GitHub    文件:ImageLoader.java   
protected Request<Bitmap> makeImageRequest(String requestUrl, int maxWidth, int maxHeight,
        ScaleType scaleType, final String cacheKey) {
    return new ImageRequest(requestUrl, new Listener<Bitmap>() {
        @Override
        public void onResponse(Bitmap response) {
            onGetImageSuccess(cacheKey, response);
        }
    }, maxWidth, maxHeight, scaleType, Config.RGB_565, new ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {
            onGetImageError(cacheKey, error);
        }
    });
}
项目:boohee_v5.6    文件:DnspodFree.java   
public static void getIpWithHost(final String host, final OnIpGetListener listener) {
    String now = DateFormatUtils.date2string(new Date(), "yyyy-MM-dd'T'HH:mm:ss");
    if (getCachedDate(host) == null || DateFormatUtils.getDifference(getCachedDate(host),
            now) > 3600000) {
        RequestManager.addRequest(new StringRequest(String.format(freeUrl, new
                Object[]{host}), new Listener<String>() {
            public void onResponse(String response) {
                Helper.showLog(DnspodFree.TAG, host + "," + response);
                if (!TextUtils.isEmpty(response)) {
                    String ip = response.split(DnspodFree.IP_SPLIT)[0];
                    if (!TextUtils.isEmpty(ip)) {
                        ip = ip.trim();
                    }
                    if (RegularUtils.isIP(ip)) {
                        OnePreference.getInstance(MyApplication.getContext()).putString(host,
                                ip + "," + DateFormatUtils.currentTimeString());
                    }
                }
                if (listener != null) {
                    listener.onIpGet();
                }
            }
        }, null), null);
    }
}
项目:boohee_v5.6    文件:DnspodFree.java   
public static void getIpWithHostNoCache(final String host, final boolean isSplit) {
    RequestManager.addRequest(new StringRequest(String.format(freeUrl, new Object[]{host}),
            new Listener<String>() {
        public void onResponse(String response) {
            String ip = response;
            if (!TextUtils.isEmpty(ip)) {
                if (isSplit) {
                    ip = response.split(DnspodFree.IP_SPLIT)[0];
                }
                if (!TextUtils.isEmpty(ip)) {
                    ip = ip.trim();
                }
                OnePreference.getInstance(MyApplication.getContext()).putString(host, ip);
            }
        }
    }, null), null);
}
项目:boohee_v5.6    文件:WelcomeActivity.java   
private void requestJson() {
    RequestManager.addRequest(new StringRequest("http://shop.boohee" +
            ".com/store/pages/story_json", new Listener<String>() {
        public void onResponse(String response) {
            try {
                List<Story> stories = Story.parseStory(response);
                if (stories != null && stories.size() > 0) {
                    WelcomeActivity.this.mDataList.clear();
                    WelcomeActivity.this.mDataList.addAll(stories);
                    WelcomeActivity.this.mAdapter.notifyDataSetChanged();
                    stories.clear();
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
            WelcomeActivity.this.setRefresh(false);
        }
    }, new ErrorListener() {
        public void onErrorResponse(VolleyError error) {
            Helper.showToast(error.toString());
            WelcomeActivity.this.setRefresh(false);
        }
    }), this);
    setRefresh(true);
}
项目:GitHub    文件:ImageLoader.java   
protected Request<Bitmap> makeImageRequest(String requestUrl, int maxWidth, int maxHeight,
        ScaleType scaleType, final String cacheKey) {
    return new ImageRequest(requestUrl, new Listener<Bitmap>() {
        @Override
        public void onResponse(Bitmap response) {
            onGetImageSuccess(cacheKey, response);
        }
    }, maxWidth, maxHeight, scaleType, Config.RGB_565, new ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {
            onGetImageError(cacheKey, error);
        }
    });
}
项目:publicProject    文件:JRYGRequest.java   
public JRYGRequest(int method, String url, Class<T> clazz, Map<String, Object> params, Response.Listener<T> listener, Response.ErrorListener errorListener) {
    super(method, url, errorListener);
    this.url = url;
    this.mListener = listener;
    this.errorListener = errorListener;
    this.mClazz = clazz;
    this.mParams = params;
    body = getBodyString();
}
项目:publicProject    文件:JRYGRequest.java   
public JRYGRequest(String url, Class<T> clazz, Map<String, Object> params, Response.Listener<T> listener, Response.ErrorListener errorListener) {
    super(Request.Method.POST, url, errorListener);
    this.url = url;
    this.mListener = listener;
    this.errorListener = errorListener;
    this.mClazz = clazz;
    this.mParams = params;
    CommonLog.d("URL:" + url);
    body = getBodyString();
}
项目:publicProject    文件:ImageLoader.java   
protected Request<Bitmap> makeImageRequest(String requestUrl, int maxWidth, int maxHeight,
        ScaleType scaleType, final String cacheKey) {
    return new ImageRequest(requestUrl, new Listener<Bitmap>() {
        @Override
        public void onResponse(Bitmap response) {
            onGetImageSuccess(cacheKey, response);
        }
    }, maxWidth, maxHeight, scaleType, Config.RGB_565, new ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {
            onGetImageError(cacheKey, error);
        }
    });
}
项目:Codeforces    文件:ImageLoader.java   
protected Request<Bitmap> makeImageRequest(String requestUrl, int maxWidth, int maxHeight,
        ScaleType scaleType, final String cacheKey) {
    return new ImageRequest(requestUrl, new Listener<Bitmap>() {
        @Override
        public void onResponse(Bitmap response) {
            onGetImageSuccess(cacheKey, response);
        }
    }, maxWidth, maxHeight, scaleType, Config.RGB_565, new ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {
            onGetImageError(cacheKey, error);
        }
    });
}
项目:GeekZone    文件:ImageLoader.java   
protected Request<Bitmap> makeImageRequest(String requestUrl, int maxWidth, int maxHeight,
        ScaleType scaleType, final String cacheKey) {
    return new ImageRequest(requestUrl, new Listener<Bitmap>() {
        @Override
        public void onResponse(Bitmap response) {
            onGetImageSuccess(cacheKey, response);
        }
    }, maxWidth, maxHeight, scaleType, Config.RGB_565, new ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {
            onGetImageError(cacheKey, error);
        }
    });
}
项目:boohee_v5.6    文件:ImageRequest.java   
public ImageRequest(String url, Listener<Bitmap> listener, int maxWidth, int maxHeight, ScaleType scaleType, Config decodeConfig, ErrorListener errorListener) {
    super(0, url, errorListener);
    setRetryPolicy(new DefaultRetryPolicy(1000, 2, IMAGE_BACKOFF_MULT));
    this.mListener = listener;
    this.mDecodeConfig = decodeConfig;
    this.mMaxWidth = maxWidth;
    this.mMaxHeight = maxHeight;
    this.mScaleType = scaleType;
}
项目:boohee_v5.6    文件:BaseJsonRequest.java   
public BaseJsonRequest(int method, String url, JsonParams jsonParams, Listener<String>
        listener, ErrorListener errorListener) {
    JsonParams jsonParams2;
    String bestUrl = DnspodFree.getBestUrl(url);
    String host = Uri.parse(url).getHost();
    if (jsonParams == null) {
        jsonParams2 = null;
    } else {
        jsonParams2 = jsonParams;
    }
    this(method, bestUrl, host, jsonParams2, listener, errorListener);
}
项目:boohee_v5.6    文件:BaseJsonRequest.java   
public BaseJsonRequest(int method, String url, String host, JsonParams jsonParams,
                       Listener<String> listener, ErrorListener errorListener) {
    String str;
    String bestUrl = DnspodFree.getBestUrl(url);
    if (jsonParams == null) {
        str = null;
    } else {
        str = jsonParams.toString();
    }
    super(method, bestUrl, str, listener, errorListener);
    parseUrlToApi(jsonParams, host);
}
项目:boohee_v5.6    文件:ImageLoader.java   
protected Request<Bitmap> makeImageRequest(String requestUrl, int maxWidth, int maxHeight, ScaleType scaleType, final String cacheKey) {
    return new ImageRequest(requestUrl, new Listener<Bitmap>() {
        public void onResponse(Bitmap response) {
            ImageLoader.this.onGetImageSuccess(cacheKey, response);
        }
    }, maxWidth, maxHeight, scaleType, Config.RGB_565, new ErrorListener() {
        public void onErrorResponse(VolleyError error) {
            ImageLoader.this.onGetImageError(cacheKey, error);
        }
    });
}
项目:GitHub    文件:JsonRequest.java   
public JsonRequest(int method, String url, String requestBody, Listener<T> listener,
        ErrorListener errorListener) {
    super(method, url, errorListener);
    mListener = listener;
    mRequestBody = requestBody;
}
项目:GitHub    文件:JsonRequest.java   
public JsonRequest(int method, String url, String requestBody, Listener<T> listener,
        ErrorListener errorListener) {
    super(method, url, errorListener);
    mListener = listener;
    mRequestBody = requestBody;
}
项目:dolores-android    文件:StringRequest.java   
public StringRequest(String url, Map<String, String> map, Listener<String> listener, ErrorListener errorListener) {
    super(Method.GET, Constants.BASE_URL + url, errorListener);
    super.setShouldCache(false);
    mListener = listener;
    mMap = map;
}
项目:GitHub    文件:RawRequest.java   
public RawRequest(String url, Listener<byte[]> listener, ErrorListener errorListener) {
  super(0, url, errorListener);
  this.mListener = listener;
  setShouldCache(false);
}
项目:boohee_v5.6    文件:ImageRequest.java   
@Deprecated
public ImageRequest(String url, Listener<Bitmap> listener, int maxWidth, int maxHeight, Config decodeConfig, ErrorListener errorListener) {
    this(url, listener, maxWidth, maxHeight, ScaleType.CENTER_INSIDE, decodeConfig, errorListener);
}
项目:boohee_v5.6    文件:JsonArrayRequest.java   
public JsonArrayRequest(int method, String url, Listener<JSONArray> listener, ErrorListener errorListener) {
    super(method, url, null, listener, errorListener);
}
项目:boohee_v5.6    文件:StringRequest.java   
public StringRequest(String url, Listener<String> listener, ErrorListener errorListener) {
    this(0, url, listener, errorListener);
}
项目:TYT    文件:JsonObjectPostRequest.java   
public JsonObjectPostRequest(String url, Listener<JSONObject> listener, ErrorListener errorListener, Map map) {
    super(Method.POST, url, errorListener);
    mListener = listener;
    mMap = map;
}
项目:AndroidCrossPromotion    文件:CustomRequest.java   
public CustomRequest(String url, Map<String, String> params,
                     Listener<JSONObject> reponseListener, ErrorListener errorListener) {
    super(Method.GET, url, errorListener);
    this.listener = reponseListener;
    this.params = params;
}
项目:AndroidCrossPromotion    文件:CustomRequest.java   
public CustomRequest(int method, String url, Map<String, String> params,
                     Listener<JSONObject> reponseListener, ErrorListener errorListener) {
    super(method, url, errorListener);
    this.listener = reponseListener;
    this.params = params;
}
项目:Codeforces    文件:JsonRequest.java   
public JsonRequest(int method, String url, String requestBody, Listener<T> listener,
        ErrorListener errorListener) {
    super(method, url, errorListener);
    mListener = listener;
    mRequestBody = requestBody;
}
项目:boohee_v5.6    文件:JsonArrayRequest.java   
public JsonArrayRequest(String url, Listener<JSONArray> listener, ErrorListener errorListener) {
    super(0, url, null, listener, errorListener);
}
项目:boohee_v5.6    文件:JsonArrayRequest.java   
public JsonArrayRequest(int method, String url, JSONObject jsonRequest, Listener<JSONArray> listener, ErrorListener errorListener) {
    super(method, url, jsonRequest == null ? null : jsonRequest.toString(), listener, errorListener);
}
项目:boohee_v5.6    文件:JsonArrayRequest.java   
public JsonArrayRequest(int method, String url, String requestBody, Listener<JSONArray> listener, ErrorListener errorListener) {
    super(method, url, requestBody, listener, errorListener);
}
项目:boohee_v5.6    文件:JsonObjectRequest.java   
public JsonObjectRequest(int method, String url, Listener<JSONObject> listener, ErrorListener errorListener) {
    super(method, url, null, listener, errorListener);
}
项目:GeekZone    文件:JsonRequest.java   
public JsonRequest(int method, String url, String requestBody, Listener<T> listener,
        ErrorListener errorListener) {
    super(method, url, errorListener);
    mListener = listener;
    mRequestBody = requestBody;
}
项目:boohee_v5.6    文件:JsonArrayRequest.java   
public JsonArrayRequest(int method, String url, JSONArray jsonRequest, Listener<JSONArray> listener, ErrorListener errorListener) {
    super(method, url, jsonRequest == null ? null : jsonRequest.toString(), listener, errorListener);
}
项目:boohee_v5.6    文件:JsonObjectRequest.java   
public JsonObjectRequest(int method, String url, JSONObject jsonRequest, Listener<JSONObject> listener, ErrorListener errorListener) {
    super(method, url, jsonRequest == null ? null : jsonRequest.toString(), listener, errorListener);
}
项目:FlyHttp    文件:CustomJsonRequest.java   
public CustomJsonRequest(int method, String url, Map<String, String> params,
                         Listener<JSONObject> responseListener, ErrorListener errorListener) {
    super(method, url, errorListener);
    this.listener = responseListener;
    this.params = params;
}
项目:dolores-android    文件:StringRequest.java   
public StringRequest(String url, int requestType, Map<String, String> map, Listener<String> listener, ErrorListener errorListener) {
    super(requestType, Constants.BASE_URL + url, errorListener);
    super.setShouldCache(false);
    mListener = listener;
    mMap = map;
}
项目:boohee_v5.6    文件:StringRequest.java   
public StringRequest(int method, String url, Listener<String> listener, ErrorListener errorListener) {
    super(method, url, errorListener);
    this.mListener = listener;
}
项目:boohee_v5.6    文件:JsonObjectRequest.java   
public JsonObjectRequest(String url, JSONObject jsonRequest, Listener<JSONObject> listener, ErrorListener errorListener) {
    this(jsonRequest == null ? 0 : 1, url, jsonRequest, (Listener) listener, errorListener);
}
项目:boohee_v5.6    文件:JsonRequest.java   
public JsonRequest(String url, String requestBody, Listener<T> listener, ErrorListener errorListener) {
    this(-1, url, requestBody, listener, errorListener);
}
项目:boohee_v5.6    文件:JsonRequest.java   
public JsonRequest(int method, String url, String requestBody, Listener<T> listener, ErrorListener errorListener) {
    super(method, url, errorListener);
    this.mListener = listener;
    this.mRequestBody = requestBody;
}
项目:boohee_v5.6    文件:JsonObjectRequest.java   
public JsonObjectRequest(int method, String url, String requestBody, Listener<JSONObject> listener, ErrorListener errorListener) {
    super(method, url, requestBody, listener, errorListener);
}
项目:boohee_v5.6    文件:JsonObjectRequest.java   
public JsonObjectRequest(String url, Listener<JSONObject> listener, ErrorListener errorListener) {
    super(0, url, null, listener, errorListener);
}