public void run() {
   if (this.imageAware.isCollected()) {
     C0126L.m33d(LOG_TASK_CANCELLED_IMAGEAWARE_COLLECTED, this.memoryCacheKey);
     this.listener.onLoadingCancelled(this.imageUri, this.imageAware.getWrappedView());
   } else if (isViewWasReused()) {
     C0126L.m33d(LOG_TASK_CANCELLED_IMAGEAWARE_REUSED, this.memoryCacheKey);
     this.listener.onLoadingCancelled(this.imageUri, this.imageAware.getWrappedView());
   } else {
     C0126L.m33d(LOG_DISPLAY_IMAGE_IN_IMAGEAWARE, this.loadedFrom, this.memoryCacheKey);
     this.displayer.display(this.bitmap, this.imageAware, this.loadedFrom);
     this.engine.cancelDisplayTaskFor(this.imageAware);
     this.listener.onLoadingComplete(this.imageUri, this.imageAware.getWrappedView(), this.bitmap);
   }
 }
Esempio n. 2
0
 protected Options prepareDecodingOptions(ImageSize imageSize, ImageDecodingInfo decodingInfo) {
   int scale;
   ImageScaleType scaleType = decodingInfo.getImageScaleType();
   if (scaleType == ImageScaleType.NONE) {
     scale = 1;
   } else if (scaleType == ImageScaleType.NONE_SAFE) {
     scale = ImageSizeUtils.computeMinImageSampleSize(imageSize);
   } else {
     boolean powerOf2;
     ImageSize targetSize = decodingInfo.getTargetSize();
     if (scaleType == ImageScaleType.IN_SAMPLE_POWER_OF_2) {
       powerOf2 = true;
     } else {
       powerOf2 = false;
     }
     scale =
         ImageSizeUtils.computeImageSampleSize(
             imageSize, targetSize, decodingInfo.getViewScaleType(), powerOf2);
   }
   if (scale > 1 && this.loggingEnabled) {
     C0126L.m33d(
         LOG_SUBSAMPLE_IMAGE,
         imageSize,
         imageSize.scaleDown(scale),
         Integer.valueOf(scale),
         decodingInfo.getImageKey());
   }
   Options decodingOptions = decodingInfo.getDecodingOptions();
   decodingOptions.inSampleSize = scale;
   return decodingOptions;
 }