com.xtremelabs.imageutils
Class AbstractImageLoader.Options

java.lang.Object
  extended by com.xtremelabs.imageutils.AbstractImageLoader.Options
Enclosing class:
AbstractImageLoader

public static class AbstractImageLoader.Options
extends java.lang.Object

This class provides all the options that can be set when making loadImage calls. See the Javadocs for the individual fields for more detail.


Nested Class Summary
static class AbstractImageLoader.Options.ScalingPreference
          AbstractImageLoader.Options.ScalingPreference.LARGER_THAN_VIEW_OR_FULL_SIZE
This option guarantees that the image being returned will be larger than the view's bounds, or it's maximum size.
 
Field Summary
 boolean autoDetectBounds
          If true, the ImageLoader will attempt to optimize the sample size for the image being returned.

Default value: true.
 java.lang.Integer heightBounds
          If specified, this value allows the cacher to conserve memory by estimating the optimal sample size.
 java.lang.Integer overrideSampleSize
          Forces the image to be decoded with the specified sample size.
 java.lang.Integer placeholderImageResourceId
          The ImageLoader will load the resource at this ID prior to making the image request.

Default value: null.
 Bitmap.Config preferedConfig
          Modify this value to change the colour format of decoded bitmaps.
 AbstractImageLoader.Options.ScalingPreference scalingPreference
          The ImageLoader has the ability to automatically scale down images according to the bounds of the ImageView provided, or the bounds specified within this options object.
 java.lang.Integer unsuccessfulLoadResourceId
          In the event that the image load fails, the resource at the provided ID will be loaded into the ImageView.

Default value: null.
 boolean useScreenSizeAsBounds
          If true, the ImageLoader will select a sample size that will optimize the image size for the size of the screen.

Default value: true.
 java.lang.Integer widthBounds
          If specified, this value allows the cacher to conserve memory by estimating the optimal sample size.
 boolean wipeOldImageOnPreload
          If set to true, the ImageLoader will, before getting the Bitmap, replace the current image within the ImageView with either a null Bitmap or the image resource indicated by the placeholderImageResourceId.

If set to false, the ImageLoader will only attempt to load the requested Bitmap to the view.
 
Constructor Summary
AbstractImageLoader.Options()
           
 
Method Summary
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

overrideSampleSize

public java.lang.Integer overrideSampleSize
Forces the image to be decoded with the specified sample size. This will override any other parameters that affect the sample size of the image.

NOTE: This value, if specified, should always be a positive power of 2. The higher the number provided, the further the image will be scaled down.

Example: A sample size of 2 will decrease the size of the image by 4. A sample size of 4 will decrease the size of the image by 16.

Default value: null.


heightBounds

public java.lang.Integer heightBounds
If specified, this value allows the cacher to conserve memory by estimating the optimal sample size. This works in conjunction with the widthBounds field, so both can be specified at the same time.

Default value: null.


widthBounds

public java.lang.Integer widthBounds
If specified, this value allows the cacher to conserve memory by estimating the optimal sample size. This works in conjunction with the heightBounds field, so both can be specified at the same time.

Default value: null.


autoDetectBounds

public boolean autoDetectBounds
If true, the ImageLoader will attempt to optimize the sample size for the image being returned.

Default value: true.


useScreenSizeAsBounds

public boolean useScreenSizeAsBounds
If true, the ImageLoader will select a sample size that will optimize the image size for the size of the screen.

Default value: true.


scalingPreference

public AbstractImageLoader.Options.ScalingPreference scalingPreference
The ImageLoader has the ability to automatically scale down images according to the bounds of the ImageView provided, or the bounds specified within this options object. This parameter is a flag for the sample size calculation logic that changes how it chooses sample sizes. See AbstractImageLoader.Options.ScalingPreference for further details.


wipeOldImageOnPreload

public boolean wipeOldImageOnPreload
If set to true, the ImageLoader will, before getting the Bitmap, replace the current image within the ImageView with either a null Bitmap or the image resource indicated by the placeholderImageResourceId.

If set to false, the ImageLoader will only attempt to load the requested Bitmap to the view.


placeholderImageResourceId

public java.lang.Integer placeholderImageResourceId
The ImageLoader will load the resource at this ID prior to making the image request.

Default value: null.


unsuccessfulLoadResourceId

public java.lang.Integer unsuccessfulLoadResourceId
In the event that the image load fails, the resource at the provided ID will be loaded into the ImageView.

Default value: null.


preferedConfig

public Bitmap.Config preferedConfig
Modify this value to change the colour format of decoded bitmaps. If set to null, the BitmapFactory will automatically select a colour format.

This options can be used to manually raise or lower the bit depth of images, which may result in memory savings.

Default value: null.

Constructor Detail

AbstractImageLoader.Options

public AbstractImageLoader.Options()