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()
          Deprecated. Use cacheInMemory(true) instead
 DisplayImageOptions.Builder cacheInMemory(boolean cacheInMemory)
          Sets whether loaded image will be cached in memory
 DisplayImageOptions.Builder cacheOnDisc()
          Deprecated. Use cacheOnDisk(true) instead
 DisplayImageOptions.Builder cacheOnDisc(boolean cacheOnDisk)
          Deprecated. Use cacheOnDisk(boolean) instead
 DisplayImageOptions.Builder cacheOnDisk(boolean cacheOnDisk)
          Sets whether loaded image will be cached on disk
 DisplayImageOptions.Builder cloneFrom(DisplayImageOptions options)
          Sets all options equal to incoming options
 DisplayImageOptions.Builder considerExifParams(boolean considerExifParams)
          Sets whether ImageLoader will consider EXIF parameters of JPEG image (rotate, flip)
 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(String, Object)
 DisplayImageOptions.Builder handler(android.os.Handler handler)
          Sets custom handler for displaying images and firing listener events.
 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 image aware view 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()
          Deprecated. Use resetViewBeforeLoading(true) instead
 DisplayImageOptions.Builder resetViewBeforeLoading(boolean resetViewBeforeLoading)
          Sets whether image aware view will be reset (set null) before image loading start
 DisplayImageOptions.Builder showImageForEmptyUri(android.graphics.drawable.Drawable drawable)
          Incoming drawable will be displayed in image aware view if empty URI (null or empty string) will be passed to ImageLoader.displayImage(...)
 DisplayImageOptions.Builder showImageForEmptyUri(int imageRes)
          Incoming image will be displayed in image aware view if empty URI (null or empty string) will be passed to ImageLoader.displayImage(...)
 DisplayImageOptions.Builder showImageOnFail(android.graphics.drawable.Drawable drawable)
          Incoming drawable will be displayed in image aware view if some error occurs during requested image loading/decoding.
 DisplayImageOptions.Builder showImageOnFail(int imageRes)
          Incoming image will be displayed in image aware view if some error occurs during requested image loading/decoding.
 DisplayImageOptions.Builder showImageOnLoading(android.graphics.drawable.Drawable drawable)
          Incoming drawable will be displayed in image aware view during image loading.
 DisplayImageOptions.Builder showImageOnLoading(int imageRes)
          Incoming image will be displayed in image aware view during image loading
 DisplayImageOptions.Builder showStubImage(int imageRes)
          Deprecated. Use showImageOnLoading(int) instead
 
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

@Deprecated
public DisplayImageOptions.Builder showStubImage(int imageRes)
Deprecated. Use showImageOnLoading(int) instead

Stub image will be displayed in image aware view during image loading

Parameters:
imageRes - Stub image resource

showImageOnLoading

public DisplayImageOptions.Builder showImageOnLoading(int imageRes)
Incoming image will be displayed in image aware view during image loading

Parameters:
imageRes - Image resource

showImageOnLoading

public DisplayImageOptions.Builder showImageOnLoading(android.graphics.drawable.Drawable drawable)
Incoming drawable will be displayed in image aware view during image loading. This option will be ignored if showImageOnLoading(int) is set.


showImageForEmptyUri

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

Parameters:
imageRes - Image resource

showImageForEmptyUri

public DisplayImageOptions.Builder showImageForEmptyUri(android.graphics.drawable.Drawable drawable)
Incoming drawable will be displayed in image aware view if empty URI (null or empty string) will be passed to ImageLoader.displayImage(...) method. This option will be ignored if showImageForEmptyUri(int) is set.


showImageOnFail

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

Parameters:
imageRes - Image resource

showImageOnFail

public DisplayImageOptions.Builder showImageOnFail(android.graphics.drawable.Drawable drawable)
Incoming drawable will be displayed in image aware view if some error occurs during requested image loading/decoding. This option will be ignored if showImageOnFail(int) is set.


resetViewBeforeLoading

public DisplayImageOptions.Builder resetViewBeforeLoading()
Deprecated. Use resetViewBeforeLoading(true) instead

image aware view will be reset (set null) before image loading start


resetViewBeforeLoading

public DisplayImageOptions.Builder resetViewBeforeLoading(boolean resetViewBeforeLoading)
Sets whether image aware view will be reset (set null) before image loading start


cacheInMemory

@Deprecated
public DisplayImageOptions.Builder cacheInMemory()
Deprecated. Use cacheInMemory(true) instead

Loaded image will be cached in memory


cacheInMemory

public DisplayImageOptions.Builder cacheInMemory(boolean cacheInMemory)
Sets whether loaded image will be cached in memory


cacheOnDisc

@Deprecated
public DisplayImageOptions.Builder cacheOnDisc()
Deprecated. Use cacheOnDisk(true) instead

Loaded image will be cached on disk


cacheOnDisc

@Deprecated
public DisplayImageOptions.Builder cacheOnDisc(boolean cacheOnDisk)
Deprecated. Use cacheOnDisk(boolean) instead

Sets whether loaded image will be cached on disk


cacheOnDisk

public DisplayImageOptions.Builder cacheOnDisk(boolean cacheOnDisk)
Sets whether loaded image will be cached on disk


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(String, Object)


considerExifParams

public DisplayImageOptions.Builder considerExifParams(boolean considerExifParams)
Sets whether ImageLoader will consider EXIF parameters of JPEG image (rotate, flip)


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 image aware view 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()


handler

public DisplayImageOptions.Builder handler(android.os.Handler handler)
Sets custom handler for displaying images and firing listener events.


cloneFrom

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


build

public DisplayImageOptions build()
Builds configured DisplayImageOptions object



Copyright © 2011-2014. All Rights Reserved.