Tabnine Logo
com.android.volley.toolbox
Code IndexAdd Tabnine to your IDE (free)

How to use com.android.volley.toolbox

Best Java code snippets using com.android.volley.toolbox (Showing top 20 results out of 738)

origin: bumptech/glide

 private static RequestQueue getInternalQueue(Context context) {
  if (internalQueue == null) {
   synchronized (Factory.class) {
    if (internalQueue == null) {
     internalQueue = Volley.newRequestQueue(context);
    }
   }
  }
  return internalQueue;
 }
}
origin: chentao0707/SimplifyReader

/**
 * Checks if the item is available in the cache.
 *
 * @param requestUrl The url of the remote image
 * @param maxWidth   The maximum width of the returned image.
 * @param maxHeight  The maximum height of the returned image.
 * @param scaleType  The scaleType of the imageView.
 * @return True if the item exists in cache, false otherwise.
 */
public boolean isCached(String requestUrl, int maxWidth, int maxHeight, ScaleType scaleType) {
  throwIfNotOnMainThread();
  String cacheKey = getCacheKey(requestUrl, maxWidth, maxHeight, scaleType);
  return mCache.getBitmap(cacheKey) != null;
}
origin: commonsguy/cw-omnibus

 void loadImage(String url, ImageView iv,
         int placeholderDrawable, int errorDrawable) {
  imageLoader.get(url,
   ImageLoader.getImageListener(iv, placeholderDrawable,
    errorDrawable));
 }
}
origin: mcxiaoke/android-volley

/**
 * Returns an ImageContainer for the requested URL.
 *
 * The ImageContainer will contain either the specified default bitmap or the loaded bitmap.
 * If the default was returned, the {@link ImageLoader} will be invoked when the
 * request is fulfilled.
 *
 * @param requestUrl The URL of the image to be loaded.
 */
public ImageContainer get(String requestUrl, final ImageListener listener) {
  return get(requestUrl, listener, 0, 0);
}
origin: mcxiaoke/android-volley

  /**
   * Returns the charset specified in the Content-Type of this header,
   * or the HTTP default (ISO-8859-1) if none can be found.
   */
  public static String parseCharset(Map<String, String> headers) {
    return parseCharset(headers, HTTP.DEFAULT_CONTENT_CHARSET);
  }
}
origin: chentao0707/SimplifyReader

private void setDefaultImageOrNull() {
  if(mDefaultImageId != 0) {
    setImageResource(mDefaultImageId);
  }
  else {
    setImageBitmap(null);
  }
}
origin: chentao0707/SimplifyReader

/**
 * @param httpStack HTTP stack to be used
 */
public BasicNetwork(HttpStack httpStack) {
  // If a pool isn't passed in, then build a small default pool that will give us a lot of
  // benefit and not use too much memory.
  this(httpStack, new ByteArrayPool(DEFAULT_POOL_SIZE));
}
origin: chentao0707/SimplifyReader

/**
 * Checks if the item is available in the cache.
 * @param requestUrl The url of the remote image
 * @param maxWidth The maximum width of the returned image.
 * @param maxHeight The maximum height of the returned image.
 * @return True if the item exists in cache, false otherwise.
 */
public boolean isCached(String requestUrl, int maxWidth, int maxHeight) {
  return isCached(requestUrl, maxWidth, maxHeight, ScaleType.CENTER_INSIDE);
}
origin: mcxiaoke/android-volley

@Override
public void onErrorResponse(VolleyError error) {
  if (mErrorImageId != 0) {
    setImageResource(mErrorImageId);
  }
}
origin: chentao0707/SimplifyReader

static int readInt(InputStream is) throws IOException {
  int n = 0;
  n |= (read(is) << 0);
  n |= (read(is) << 8);
  n |= (read(is) << 16);
  n |= (read(is) << 24);
  return n;
}
origin: chentao0707/SimplifyReader

  @Override
  public void onResponse(Bitmap response) {
    onGetImageSuccess(cacheKey, response);
  }
}, maxWidth, maxHeight, scaleType, Config.RGB_565, new ErrorListener() {
origin: chentao0707/SimplifyReader

/**
 * @deprecated Use {@link #getBodyContentType()}.
 */
@Override
public String getPostBodyContentType() {
  return getBodyContentType();
}
origin: chentao0707/SimplifyReader

/**
 * @deprecated Use {@link #getBody()}.
 */
@Override
public byte[] getPostBody() {
  return getBody();
}
origin: mcxiaoke/android-volley

/**
 * Creates a default instance of the worker pool and calls {@link RequestQueue#start()} on it.
 * You may set a maximum size of the disk cache in bytes.
 *
 * @param context A {@link Context} to use for creating the cache dir.
 * @param maxDiskCacheBytes the maximum size of the disk cache, in bytes. Use -1 for default size.
 * @return A started {@link RequestQueue} instance.
 */
public static RequestQueue newRequestQueue(Context context, int maxDiskCacheBytes) {
  return newRequestQueue(context, null, maxDiskCacheBytes);
}

origin: mcxiaoke/android-volley

/**
 * Checks if the item is available in the cache.
 *
 * @param requestUrl The url of the remote image
 * @param maxWidth   The maximum width of the returned image.
 * @param maxHeight  The maximum height of the returned image.
 * @param scaleType  The scaleType of the imageView.
 * @return True if the item exists in cache, false otherwise.
 */
public boolean isCached(String requestUrl, int maxWidth, int maxHeight, ScaleType scaleType) {
  throwIfNotOnMainThread();
  String cacheKey = getCacheKey(requestUrl, maxWidth, maxHeight, scaleType);
  return mCache.getBitmap(cacheKey) != null;
}
origin: chentao0707/SimplifyReader

/**
 * Returns an ImageContainer for the requested URL.
 *
 * The ImageContainer will contain either the specified default bitmap or the loaded bitmap.
 * If the default was returned, the {@link com.android.volley.toolbox.ImageLoader} will be invoked when the
 * request is fulfilled.
 *
 * @param requestUrl The URL of the image to be loaded.
 */
public ImageContainer get(String requestUrl, final ImageListener listener) {
  return get(requestUrl, listener, 0, 0);
}
origin: chentao0707/SimplifyReader

  /**
   * Returns the charset specified in the Content-Type of this header,
   * or the HTTP default (ISO-8859-1) if none can be found.
   */
  public static String parseCharset(Map<String, String> headers) {
    return parseCharset(headers, HTTP.DEFAULT_CONTENT_CHARSET);
  }
}
origin: mcxiaoke/android-volley

  @Override
  public void onResponse(Bitmap response) {
    onGetImageSuccess(cacheKey, response);
  }
}, maxWidth, maxHeight, scaleType, Config.RGB_565, new ErrorListener() {
origin: mcxiaoke/android-volley

/**
 * @deprecated Use {@link #getBodyContentType()}.
 */
@Override
public String getPostBodyContentType() {
  return getBodyContentType();
}
origin: chentao0707/SimplifyReader

/**
 * Equivalent to calling {@link #get(String, com.android.volley.toolbox.ImageLoader.ImageListener, int, int, android.widget.ImageView.ScaleType)} with
 * {@code Scaletype == ScaleType.CENTER_INSIDE}.
 */
public ImageContainer get(String requestUrl, ImageListener imageListener,
    int maxWidth, int maxHeight) {
  return get(requestUrl, imageListener, maxWidth, maxHeight, ScaleType.CENTER_INSIDE);
}
com.android.volley.toolbox

Most used classes

  • Volley
  • ImageLoader
    Helper that handles loading and caching images from remote URLs. The simple way to use this class is
  • HttpHeaderParser
    Utility methods for parsing HTTP headers.
  • HurlStack
    An HttpStack based on HttpURLConnection.
  • StringRequest
    A canned request for retrieving the response body at a given URL as a String.
  • JsonObjectRequest,
  • BasicNetwork,
  • DiskBasedCache,
  • ImageRequest,
  • ImageLoader$ImageContainer,
  • ByteArrayPool,
  • HttpClientStack,
  • RequestFuture,
  • DiskBasedCache$CacheHeader,
  • ImageLoader$ImageCache,
  • ImageLoader$ImageListener,
  • PoolingByteArrayOutputStream,
  • DiskBasedCache$CountingInputStream,
  • HttpClientStack$HttpPatch
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now