/** * 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; }
/** * 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; }
/** * 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; }
final String cacheKey = getCacheKey(requestUrl, maxWidth, maxHeight, scaleType);
final String cacheKey = getCacheKey(requestUrl, maxWidth, maxHeight, scaleType);
final String cacheKey = getCacheKey(requestUrl, maxWidth, maxHeight, scaleType);
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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. */ /* * 检查 图片数据 是否被缓存 * 根据四个数据匹配图片: * 1. requestUrl:该图片的 url * 2. maxWidth:该图片的 最大宽度 * 3. maxHeight:该图片的 最大高度 * 4. scaleType:该图片的 ImageView.ScaleType( CENTER_CROP, FIT_XY ... ) */ public boolean isCached(String requestUrl, int maxWidth, int maxHeight, ScaleType scaleType) { // 检查是否为 主 UI 线程 throwIfNotOnMainThread(); // 根据数据,获取 cacheKey String cacheKey = getCacheKey(requestUrl, maxWidth, maxHeight, scaleType); /* * 从 外部提供的 ImageCache 实现类中 * 去查找该 url 对应的 Bitmap 缓存 */ return mCache.getBitmap(cacheKey) != null; }
final String cacheKey = getCacheKey(requestUrl, maxWidth, maxHeight, scaleType);
final String cacheKey = getCacheKey(requestUrl, maxWidth, maxHeight, scaleType);
final String cacheKey = getCacheKey(requestUrl, maxWidth, maxHeight);