示例#1
0
 private void updateTileProvider() {
   ImageEntry entry = mImageCache.get(getVersion(mCurrentIndex));
   if (entry == null) { // in loading
     mTileProvider.clear();
   } else {
     updateTileProvider(entry);
   }
 }
示例#2
0
 private void updateTileProvider(ImageEntry entry) {
   Bitmap screenNail = entry.screenNail;
   BitmapRegionDecoder fullImage = entry.fullImage;
   if (screenNail != null) {
     if (fullImage != null) {
       mTileProvider.setBackupImage(screenNail, fullImage.getWidth(), fullImage.getHeight());
       mTileProvider.setRegionDecoder(fullImage);
     } else {
       int width = screenNail.getWidth();
       int height = screenNail.getHeight();
       mTileProvider.setBackupImage(screenNail, width, height);
     }
   } else {
     mTileProvider.clear();
     if (entry.failToLoad) mTileProvider.setFailedToLoad();
   }
 }
示例#3
0
  public void pause() {
    mIsActive = false;

    mReloadTask.terminate();
    mReloadTask = null;

    mSource.removeContentListener(mSourceListener);

    for (ImageEntry entry : mImageCache.values()) {
      if (entry.fullImageTask != null) entry.fullImageTask.cancel();
      if (entry.screenNailTask != null) entry.screenNailTask.cancel();
    }
    mImageCache.clear();
    mTileProvider.clear();
  }
示例#4
0
 public boolean isFailedToLoad() {
   return mTileProvider.isFailedToLoad();
 }
示例#5
0
 public Bitmap getTile(int level, int x, int y, int tileSize) {
   return mTileProvider.getTile(level, x, y, tileSize);
 }
示例#6
0
 public int getLevelCount() {
   return mTileProvider.getLevelCount();
 }
示例#7
0
 public int getImageWidth() {
   return mTileProvider.getImageWidth();
 }
示例#8
0
 public int getImageHeight() {
   return mTileProvider.getImageHeight();
 }
示例#9
0
 public Bitmap getBackupImage() {
   return mTileProvider.getBackupImage();
 }