Пример #1
0
 private boolean loadThumbnailFromCache() {
   DebugLog.d(
       LOG_TAG, "loadThumbnailFromCache loadFromCache mUrl:" + mUrl + " mConfig:" + mConfig);
   DebugLog.d(
       LOG_TAG,
       "loadThumbnailFromCache loadFromCache mUrl:"
           + mUrl
           + " mConfig.mImageLoader:"
           + mConfig.mImageLoader);
   if (mConfig == null || mConfig.mImageLoader == null) {
     return false;
   }
   Bitmap bitmap =
       mConfig.mImageLoader.getBitmapFromCache(mWallPaper.getImgUrl() + THUMBNAIL_POSTFIX);
   DebugLog.d(
       LOG_TAG,
       "loadThumbnailFromCache loadFromCache mUrl:" + mUrl + "loadImageBitmap bitmap:" + bitmap);
   if (bitmap != null) {
     this.setUrl(mWallPaper.getImgUrl());
     this.setImageBitmap(bitmap);
     return true;
   } else {
     //            this.setBackGroundColorAndRemoveImage(mWallPaper);
     //            loadStart();
     return false;
   }
 }
Пример #2
0
 public void setBackGroundColorAndRemoveImage(Wallpaper paper) {
   if (paper != null) {
     if (mUrl.equals(paper.getImgUrl())) {
       return;
     }
     mUrl = paper.getImgUrl();
     setImageBitmap(null);
   }
 }
Пример #3
0
 public void loadImageBitmap(
     Wallpaper wallpaper /*, int posOfListener*/, boolean immediatelyLoad) {
   //    	mPosOfListener = posOfListener;
   mWallPaper = wallpaper;
   this.mUrl = wallpaper.getImgUrl();
   this.setTag(mUrl);
   if (DebugLog.DEBUG) {
     DebugLog.d(LOG_TAG, "loadImageBitmap mUrl" + mUrl);
   }
   this.setmShowState(ShowState.SHOW_NOIMAGE);
   mConfig.mImageLoader.loadImageToView(this /*, posOfListener*/);
   boolean isLoadFromCache = loadFromCache();
   if (!isLoadFromCache) {
     boolean isLoadThumbnailFromCache = loadThumbnailFromCache();
     if (!isLoadThumbnailFromCache) {
       this.setImageResource(mConfig.startBitmapID);
       this.setmShowState(ShowState.SHOW_NOIMAGE);
     } else {
       this.setmShowState(ShowState.SHOW_THUMBNAIL);
     }
   } else {
     this.setmShowState(ShowState.SHOW_IMAGE);
   }
 }