Bitmap cachedBitmap = mCache.getBitmap(cacheKey); if (cachedBitmap != null) {
/** * Handler for when an image was successfully loaded. * @param cacheKey The cache key that is associated with the image request. * @param response The bitmap that was returned from the network. */ protected void onGetImageSuccess(String cacheKey, Bitmap response) { // cache the image that was fetched. mCache.putBitmap(cacheKey, response); // remove the request from the list of in-flight requests. BatchedImageRequest request = mInFlightRequests.remove(cacheKey); if (request != null) { // Update the response bitmap. request.mResponseBitmap = response; // Send the batched response batchResponse(cacheKey, request); } }
Bitmap cachedBitmap = mCache.getBitmap(cacheKey);
Bitmap cachedBitmap = mCache.getBitmap(cacheKey); if (cachedBitmap != null) {
Bitmap cachedBitmap = mCache.getBitmap(cacheKey); if (cachedBitmap != null) {
Bitmap cachedBitmap = mCache.getBitmap(cacheKey); if (cachedBitmap != null) {
Bitmap cachedBitmap = mCache.getBitmap(cacheKey); if (cachedBitmap != null) {
Bitmap cachedBitmap = mCache.getBitmap(cacheKey); if (cachedBitmap != null) {
Bitmap cachedBitmap = mCache.getBitmap(cacheKey); if (cachedBitmap != null) {
Bitmap cachedBitmap = mCache.getBitmap(cacheKey); if (cachedBitmap != null) {
Bitmap cachedBitmap = mCache.getBitmap(cacheKey); if (cachedBitmap != null) {
Bitmap cachedBitmap = mCache.getBitmap(cacheKey); if (cachedBitmap != null) {
Bitmap cachedBitmap = mCache.getBitmap(cacheKey); if (cachedBitmap != null) {
mCache.putBitmap(cacheKey, response);
/** * 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; }
/** * Handler for when an image was successfully loaded. * @param cacheKey The cache key that is associated with the image request. * @param response The bitmap that was returned from the network. * �ɹ���ȡͼƬ���� */ private void onGetImageSuccess(String cacheKey, Bitmap response) { // cache the image that was fetched. //����ͼƬ mCache.putBitmap(cacheKey, response); // ������ɣ�����Ҫ��� // remove the request from the list of in-flight requests. BatchedImageRequest request = mInFlightRequests.remove(cacheKey); if (request != null) { // Update the response bitmap. request.mResponseBitmap = response; // Send the batched response //������ batchResponse(cacheKey, request); } }
/** * Handler for when an image was successfully loaded. * @param cacheKey The cache key that is associated with the image request. * @param response The bitmap that was returned from the network. */ protected void onGetImageSuccess(String cacheKey, Bitmap response) { // cache the image that was fetched. mCache.putBitmap(cacheKey, response); // remove the request from the list of in-flight requests. BatchedImageRequest request = mInFlightRequests.remove(cacheKey); if (request != null) { // Update the response bitmap. request.mResponseBitmap = response; // Send the batched response batchResponse(cacheKey, request); } }
/** * Handler for when an image was successfully loaded. * @param cacheKey The cache key that is associated with the image request. * @param response The bitmap that was returned from the network. */ protected void onGetImageSuccess(String cacheKey, Bitmap response) { // cache the image that was fetched. mCache.putBitmap(cacheKey, response); // remove the request from the list of in-flight requests. BatchedImageRequest request = mInFlightRequests.remove(cacheKey); if (request != null) { // Update the response bitmap. request.mResponseBitmap = response; // Send the batched response batchResponse(cacheKey, request); } }
/** * Handler for when an image was successfully loaded. * @param cacheKey The cache key that is associated with the image request. * @param response The bitmap that was returned from the network. */ protected void onGetImageSuccess(String cacheKey, Bitmap response) { // cache the image that was fetched. mCache.putBitmap(cacheKey, response); // remove the request from the list of in-flight requests. BatchedImageRequest request = mInFlightRequests.remove(cacheKey); if (request != null) { // Update the response bitmap. request.mResponseBitmap = response; // Send the batched response batchResponse(cacheKey, request); } }
/** * Handler for when an image was successfully loaded. * @param cacheKey The cache key that is associated with the image request. * @param response The bitmap that was returned from the network. */ protected void onGetImageSuccess(String cacheKey, Bitmap response) { // cache the image that was fetched. mCache.putBitmap(cacheKey, response); // remove the request from the list of in-flight requests. BatchedImageRequest request = mInFlightRequests.remove(cacheKey); if (request != null) { // Update the response bitmap. request.mResponseBitmap = response; // Send the batched response batchResponse(cacheKey, request); } }