com.nostra13.universalimageloader.core
Class DisplayImageOptions.Builder

java.lang.Object
  extended by com.nostra13.universalimageloader.core.DisplayImageOptions.Builder
Enclosing class:
DisplayImageOptions

public static class DisplayImageOptions.Builder
extends Object

Builder for DisplayImageOptions

Author:
Sergey Tarasevich (nostra13[at]gmail[dot]com)

Constructor Summary
DisplayImageOptions.Builder()
           
 
Method Summary
 DisplayImageOptions.Builder bitmapConfig(android.graphics.Bitmap.Config bitmapConfig)
          Sets bitmap config for image decoding.
 DisplayImageOptions build()
          Builds configured DisplayImageOptions object
 DisplayImageOptions.Builder cacheInMemory()
          Loaded image will be cached in memory
 DisplayImageOptions.Builder cacheOnDisc()
          Loaded image will be cached on disc
 DisplayImageOptions.Builder cloneFrom(DisplayImageOptions options)
          Sets all options equal to incoming options
 DisplayImageOptions.Builder decodingOptions(android.graphics.BitmapFactory.Options decodingOptions)
          Sets options for image decoding.
 DisplayImageOptions.Builder delayBeforeLoading(int delayInMillis)
          Sets delay time before starting loading task.
 DisplayImageOptions.Builder displayer(BitmapDisplayer displayer)
          Sets custom displayer for image loading task.
 DisplayImageOptions.Builder extraForDownloader(Object extra)
          Sets auxiliary object which will be passed to ImageDownloader#getStream(java.net.URI, Object)
 DisplayImageOptions.Builder imageScaleType(ImageScaleType imageScaleType)
          Sets scale type for decoding image.
 DisplayImageOptions.Builder postProcessor(BitmapProcessor postProcessor)
          Sets bitmap processor which will be process bitmaps before they will be displayed in ImageView but after they'll have been saved in memory cache.
 DisplayImageOptions.Builder preProcessor(BitmapProcessor preProcessor)
          Sets bitmap processor which will be process bitmaps before they will be cached in memory.
 DisplayImageOptions.Builder resetViewBeforeLoading()
          ImageView will be reset (set null) before image loading start
 DisplayImageOptions.Builder showImageForEmptyUri(int imageRes)
          Incoming image will be displayed in ImageView if empty URI (null or empty string) will be passed to ImageLoader.displayImage(...)
 DisplayImageOptions.Builder showImageOnFail(int imageRes)
          Incoming image will be displayed in ImageView if some error occurs during requested image loading/decoding.
 DisplayImageOptions.Builder showStubImage(int stubImageRes)
          Stub image will be displayed in ImageView during image loading
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DisplayImageOptions.Builder

public DisplayImageOptions.Builder()
Method Detail

showStubImage

public DisplayImageOptions.Builder showStubImage(int stubImageRes)
Stub image will be displayed in ImageView during image loading

Parameters:
stubImageRes - Stub image resource

showImageForEmptyUri

public DisplayImageOptions.Builder showImageForEmptyUri(int imageRes)
Incoming image will be displayed in ImageView if empty URI (null or empty string) will be passed to ImageLoader.displayImage(...) method.

Parameters:
imageRes - Image resource

showImageOnFail

public DisplayImageOptions.Builder showImageOnFail(int imageRes)
Incoming image will be displayed in ImageView if some error occurs during requested image loading/decoding.

Parameters:
imageRes - Image resource

resetViewBeforeLoading

public DisplayImageOptions.Builder resetViewBeforeLoading()
ImageView will be reset (set null) before image loading start


cacheInMemory

public DisplayImageOptions.Builder cacheInMemory()
Loaded image will be cached in memory


cacheOnDisc

public DisplayImageOptions.Builder cacheOnDisc()
Loaded image will be cached on disc


imageScaleType

public DisplayImageOptions.Builder imageScaleType(ImageScaleType imageScaleType)
Sets scale type for decoding image. This parameter is used while define scale size for decoding image to Bitmap. Default value - ImageScaleType.IN_SAMPLE_POWER_OF_2


bitmapConfig

public DisplayImageOptions.Builder bitmapConfig(android.graphics.Bitmap.Config bitmapConfig)
Sets bitmap config for image decoding. Default value - Bitmap.Config#ARGB_8888


decodingOptions

public DisplayImageOptions.Builder decodingOptions(android.graphics.BitmapFactory.Options decodingOptions)
Sets options for image decoding.
NOTE: BitmapFactory.Options.inSampleSize of incoming options will NOT be considered. Library calculate the most appropriate sample size itself according yo imageScaleType(ImageScaleType) options.
NOTE: This option overlaps bitmapConfig() option.


delayBeforeLoading

public DisplayImageOptions.Builder delayBeforeLoading(int delayInMillis)
Sets delay time before starting loading task. Default - no delay.


extraForDownloader

public DisplayImageOptions.Builder extraForDownloader(Object extra)
Sets auxiliary object which will be passed to ImageDownloader#getStream(java.net.URI, Object)


preProcessor

public DisplayImageOptions.Builder preProcessor(BitmapProcessor preProcessor)
Sets bitmap processor which will be process bitmaps before they will be cached in memory. So memory cache will contain bitmap processed by incoming preProcessor.
Image will be pre-processed even if caching in memory is disabled.


postProcessor

public DisplayImageOptions.Builder postProcessor(BitmapProcessor postProcessor)
Sets bitmap processor which will be process bitmaps before they will be displayed in ImageView but after they'll have been saved in memory cache.


displayer

public DisplayImageOptions.Builder displayer(BitmapDisplayer displayer)
Sets custom displayer for image loading task. Default value - DefaultConfigurationFactory.createBitmapDisplayer()


cloneFrom

public DisplayImageOptions.Builder cloneFrom(DisplayImageOptions options)
Sets all options equal to incoming options


build

public DisplayImageOptions build()
Builds configured DisplayImageOptions object



Copyright © 2011-2013. All Rights Reserved.