Android Open Source - SIC Display Image Task






From Project

Back to project page SIC.

License

The source code is released under:

MIT License

If you think the Android project SIC listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.sun.imageloader.concurrent;
// w w w .ja  va  2 s. c om
import com.sun.imageloader.core.ImageKey;
import com.sun.imageloader.core.ImageSettings;
import com.sun.imageloader.core.api.ImageTaskListener;
import android.graphics.Bitmap;
import android.widget.ImageView;

public class DisplayImageTask implements Runnable {

  private final ImageSettings _imageSettings;
  private final Bitmap _bitmap;
  private ImageTaskListener _taskListener;
  /**
   * {@linkplain DisplayImageTask} is used to display the {@linkplain Bitmap} into the {@linkplain ImageView}.
   * 
   * @param imageSettings_
   *       the settings associated with the {@linkplain Bitmap} that will be loaded
   * @param bitmap_
   *       the {@linkplain Bitmap} to display
   * @param imageViewMap_
   *       the map which associates {@linkplain ImageView} objects with the {@link ImageKey} 
   *       
   */
  public DisplayImageTask (ImageSettings imageSettings_, Bitmap bitmap_, ImageTaskListener taskListener_){
    _imageSettings = imageSettings_;
    _bitmap = bitmap_;
    _taskListener = taskListener_;
  }
  
  @Override
  public void run() {
      if (_imageSettings.getImageView().getTag().equals(_imageSettings.getImageKey())){
      _taskListener.preImageLoad(_imageSettings);
      _imageSettings.getImageView().setImageBitmap(_bitmap);
      _taskListener.onImageLoadComplete(_bitmap, _imageSettings);
    }
           
  }


}




Java Source Code List

com.sun.imageloader.cache.api.MemoryCache.java
com.sun.imageloader.cache.impl.DiskCache.java
com.sun.imageloader.cache.impl.ImageFileFilter.java
com.sun.imageloader.cache.impl.LRUCache.java
com.sun.imageloader.cache.impl.SoftCache.java
com.sun.imageloader.computable.impl.ComputableImage.java
com.sun.imageloader.computable.impl.Computable.java
com.sun.imageloader.concurrent.ComputableCallable.java
com.sun.imageloader.concurrent.DisplayImageTask.java
com.sun.imageloader.concurrent.ImageLoaderTask.java
com.sun.imageloader.core.FlingLock.java
com.sun.imageloader.core.ImageKey.java
com.sun.imageloader.core.ImagePreferences.java
com.sun.imageloader.core.ImageSettings.java
com.sun.imageloader.core.ImageWriter.java
com.sun.imageloader.core.SimpleImageListenerImpl.java
com.sun.imageloader.core.UrlImageLoaderConfiguration.java
com.sun.imageloader.core.UrlImageLoader.java
com.sun.imageloader.core.UrlImageTaskExecutor.java
com.sun.imageloader.core.api.FailedTaskReason.java
com.sun.imageloader.core.api.ImageFailListenter.java
com.sun.imageloader.core.api.ImageTaskListener.java
com.sun.imageloader.core.api.Settings.java
com.sun.imageloader.downloader.api.ImageRetriever.java
com.sun.imageloader.downloader.impl.ImageDownloader.java
com.sun.imageloader.downloader.impl.ImageRetrieverFactory.java
com.sun.imageloader.downloader.impl.Scheme.java
com.sun.imageloader.imagedecoder.api.ImageDecoder.java
com.sun.imageloader.imagedecoder.impl.SimpleImageDecoder.java
com.sun.imageloader.memorizer.api.AMemorizer.java
com.sun.imageloader.memorizer.api.BitmapMemorizer.java
com.sun.imageloader.memorizer.api.IMemorizer.java
com.sun.imageloader.memorizer.api.InterruptedImageLoadException.java
com.sun.imageloader.utils.KeyUtils.java
com.sun.imageloader.utils.L.java
com.sun.imageloader.utils.ViewUtils.java