congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ImageLoader$ImageCache.getBitmap
Code IndexAdd Tabnine to your IDE (free)

How to use
getBitmap
method
in
com.android.volley.toolbox.ImageLoader$ImageCache

Best Java code snippets using com.android.volley.toolbox.ImageLoader$ImageCache.getBitmap (Showing top 20 results out of 315)

origin: mcxiaoke/android-volley

@Test
public void getWithCacheMiss() throws Exception {
  when(mImageCache.getBitmap(anyString())).thenReturn(null);
  ImageLoader.ImageListener listener = mock(ImageLoader.ImageListener.class);
  // Ask for the image to be loaded.
  mImageLoader.get("http://foo", listener);
  // Second pass to test deduping logic.
  mImageLoader.get("http://foo", listener);
  // Response callback should be called both times.
  verify(listener, times(2)).onResponse(any(ImageLoader.ImageContainer.class), eq(true));
  // But request should be enqueued only once.
  verify(mRequestQueue, times(1)).add(any(Request.class));
}
origin: jiangqqlmj/FastDev4Android

@Test
public void getWithCacheMiss() throws Exception {
  when(mImageCache.getBitmap(anyString())).thenReturn(null);
  ImageLoader.ImageListener listener = mock(ImageLoader.ImageListener.class);
  // Ask for the image to be loaded.
  mImageLoader.get("http://foo", listener);
  // Second pass to test deduping logic.
  mImageLoader.get("http://foo", listener);
  // Response callback should be called both times.
  verify(listener, times(2)).onResponse(any(ImageLoader.ImageContainer.class), eq(true));
  // But request should be enqueued only once.
  verify(mRequestQueue, times(1)).add(any(Request.class));
}
origin: mcxiaoke/android-volley

@Test
public void getWithCacheHit() throws Exception {
  Bitmap bitmap = Bitmap.createBitmap(1, 1, null);
  ImageLoader.ImageListener listener = mock(ImageLoader.ImageListener.class);
  when(mImageCache.getBitmap(anyString())).thenReturn(bitmap);
  ImageLoader.ImageContainer ic = mImageLoader.get("http://foo", listener);
  Assert.assertSame(bitmap, ic.getBitmap());
  verify(listener).onResponse(ic, true);
}
origin: tazimete/android-app-food-delivery-system

@Test
public void getWithCacheMiss() throws Exception {
  when(mImageCache.getBitmap(anyString())).thenReturn(null);
  ImageLoader.ImageListener listener = mock(ImageLoader.ImageListener.class);
  // Ask for the image to be loaded.
  mImageLoader.get("http://foo", listener);
  // Second pass to test deduping logic.
  mImageLoader.get("http://foo", listener);
  // Response callback should be called both times.
  verify(listener, times(2)).onResponse(any(ImageLoader.ImageContainer.class), eq(true));
  // But request should be enqueued only once.
  verify(mRequestQueue, times(1)).add(any(Request.class));
}
origin: chuyangliu/tastysnake

@Test
public void getWithCacheHit() throws Exception {
  Bitmap bitmap = Bitmap.createBitmap(1, 1, null);
  ImageLoader.ImageListener listener = mock(ImageLoader.ImageListener.class);
  when(mImageCache.getBitmap(anyString())).thenReturn(bitmap);
  ImageLoader.ImageContainer ic = mImageLoader.get("http://foo", listener);
  Assert.assertSame(bitmap, ic.getBitmap());
  verify(listener).onResponse(ic, true);
}
origin: MewX/light-novel-library_Wenku8_Android

@Test
public void getWithCacheHit() throws Exception {
  Bitmap bitmap = Bitmap.createBitmap(1, 1, null);
  ImageLoader.ImageListener listener = mock(ImageLoader.ImageListener.class);
  when(mImageCache.getBitmap(anyString())).thenReturn(bitmap);
  ImageLoader.ImageContainer ic = mImageLoader.get("http://foo", listener);
  Assert.assertSame(bitmap, ic.getBitmap());
  verify(listener).onResponse(ic, true);
}
origin: MewX/light-novel-library_Wenku8_Android

@Test
public void isCachedChecksCache() throws Exception {
  when(mImageCache.getBitmap(anyString())).thenReturn(null);
  Assert.assertFalse(mImageLoader.isCached("http://foo", 0, 0));
}
origin: chuyangliu/tastysnake

@Test
public void isCachedChecksCache() throws Exception {
  when(mImageCache.getBitmap(anyString())).thenReturn(null);
  Assert.assertFalse(mImageLoader.isCached("http://foo", 0, 0));
}
origin: tazimete/android-app-food-delivery-system

@Test
public void getWithCacheHit() throws Exception {
  Bitmap bitmap = Bitmap.createBitmap(1, 1, null);
  ImageLoader.ImageListener listener = mock(ImageLoader.ImageListener.class);
  when(mImageCache.getBitmap(anyString())).thenReturn(bitmap);
  ImageLoader.ImageContainer ic = mImageLoader.get("http://foo", listener);
  Assert.assertSame(bitmap, ic.getBitmap());
  verify(listener).onResponse(ic, true);
}
origin: tazimete/android-app-food-delivery-system

@Test
public void isCachedChecksCache() throws Exception {
  when(mImageCache.getBitmap(anyString())).thenReturn(null);
  Assert.assertFalse(mImageLoader.isCached("http://foo", 0, 0));
}
origin: xuningjack/AndroidNet

/**
 * 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) {
  throwIfNotOnMainThread();
  String cacheKey = getCacheKey(requestUrl, maxWidth, maxHeight);
  return mCache.getBitmap(cacheKey) != null;
}
origin: jiangqqlmj/FastDev4Android

Bitmap cachedBitmap = mCache.getBitmap(cacheKey);
if (cachedBitmap != null) {
origin: chentao0707/SimplifyReader

Bitmap cachedBitmap = mCache.getBitmap(cacheKey);
if (cachedBitmap != null) {
origin: mcxiaoke/android-volley

Bitmap cachedBitmap = mCache.getBitmap(cacheKey);
if (cachedBitmap != null) {
origin: jiangqqlmj/FastDev4Android

/**
 * 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

/**
 * 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: 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: jiangqqlmj/FastDev4Android

@Test
public void getWithCacheHit() throws Exception {
  Bitmap bitmap = Bitmap.createBitmap(1, 1, null);
  ImageLoader.ImageListener listener = mock(ImageLoader.ImageListener.class);
  when(mImageCache.getBitmap(anyString())).thenReturn(bitmap);
  ImageLoader.ImageContainer ic = mImageLoader.get("http://foo", listener);
  Assert.assertSame(bitmap, ic.getBitmap());
  verify(listener).onResponse(ic, true);
}
origin: jiangqqlmj/FastDev4Android

@Test
public void isCachedChecksCache() throws Exception {
  when(mImageCache.getBitmap(anyString())).thenReturn(null);
  Assert.assertFalse(mImageLoader.isCached("http://foo", 0, 0));
}
origin: mcxiaoke/android-volley

@Test
public void isCachedChecksCache() throws Exception {
  when(mImageCache.getBitmap(anyString())).thenReturn(null);
  Assert.assertFalse(mImageLoader.isCached("http://foo", 0, 0));
}
com.android.volley.toolboxImageLoader$ImageCachegetBitmap

Javadoc

根据 请求 url,去从缓存中获取该 url 对应的 Bitmap

Popular methods of ImageLoader$ImageCache

  • putBitmap

Popular in Java

  • Making http requests using okhttp
  • requestLocationUpdates (LocationManager)
  • getContentResolver (Context)
  • getSystemService (Context)
  • Menu (java.awt)
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Collectors (java.util.stream)
  • JFrame (javax.swing)
  • Table (org.hibernate.mapping)
    A relational table
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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