Ejemplo n.º 1
0
  /** Check weather this imageTask has cache Drawable data. */
  public boolean queryCache(ImageTask imageTask, CubeImageView imageView) {
    if (null == mImageProvider) {
      return false;
    }
    BitmapDrawable drawable = mImageProvider.getBitmapFromMemCache(imageTask);

    if (imageTask.getStatistics() != null) {
      imageTask.getStatistics().s0_afterCheckMemoryCache(drawable != null);
    }
    if (drawable == null) {
      return false;
    }

    if (DEBUG) {
      CLog.d(
          LOG_TAG,
          MSG_HIT_CACHE,
          imageTask,
          drawable.getIntrinsicWidth(),
          drawable.getIntrinsicHeight());
    }
    imageTask.addImageView(imageView);
    imageTask.onLoadTaskFinish(drawable, mImageLoadHandler);
    return true;
  }
Ejemplo n.º 2
0
    @Override
    public void onFinish(boolean canceled) {
      if (DEBUG) {
        CLog.d(LOG_TAG, MSG_TASK_FINISH, this, mImageTask, mImageLoader.mExitTasksEarly);
      }
      if (mImageLoader.mExitTasksEarly) {
        return;
      }

      if (!isCancelled() && !mImageLoader.mExitTasksEarly) {
        mImageTask.onLoadTaskFinish(mDrawable, mImageLoader.mImageLoadHandler);
      }

      mImageLoader.mLoadWorkList.remove(mImageTask.getIdentityKey());
    }