com.xtremelabs.imageutils
Enum AbstractImageLoader.Options.ScalingPreference
java.lang.Object
java.lang.Enum<AbstractImageLoader.Options.ScalingPreference>
com.xtremelabs.imageutils.AbstractImageLoader.Options.ScalingPreference
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<AbstractImageLoader.Options.ScalingPreference>
- Enclosing class:
- AbstractImageLoader.Options
public static enum AbstractImageLoader.Options.ScalingPreference
- extends java.lang.Enum<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. The image may be scaled down if it is possible to do so without becoming smaller than either of
the provided bounds. The image will not be scaled unless both a width and height bounds are specified.
MATCH_TO_LARGER_DIMENSION
This option is nearly identical to LARGER_THAN_VIEW_OR_FULL_SIZE
. The only difference is that if bounds are provided for only one dimension of the ImageView (ie. width OR height), the
image may be scaled according to that dimension.
MATCH_TO_SMALLER_DIMENSION
This option is nearly identical to LARGER_THAN_VIEW_OR_FULL_SIZE
. They differ in that if bounds are provided for only one dimension of the ImageView (ie. width OR height), the image
may be scaled according to that dimension, and if both width and height are provided, the image will scale to best fit within the bounds (as opposed to the other two options above, which will scale to the
larger of the two dimensions only).
ROUND_TO_CLOSEST_MATCH
The dimensions of the image returned will be as close to the dimension of the bounds as possible. The bitmap returned may be scaled down to be smaller than the view. This option may degrade image quality, but
often will consume less memory. This option will give preference to the smaller of the two bounds.
SMALLER_THAN_VIEW
The dimensions of the image being returned is guaranteed to be equal to or smaller than the size of the bounds provided. This guarantees memory savings in the event that images are larger than the ImageViews
they are being loaded into.
Methods inherited from class java.lang.Enum |
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
SMALLER_THAN_VIEW
public static final AbstractImageLoader.Options.ScalingPreference SMALLER_THAN_VIEW
ROUND_TO_CLOSEST_MATCH
public static final AbstractImageLoader.Options.ScalingPreference ROUND_TO_CLOSEST_MATCH
LARGER_THAN_VIEW_OR_FULL_SIZE
public static final AbstractImageLoader.Options.ScalingPreference LARGER_THAN_VIEW_OR_FULL_SIZE
MATCH_TO_LARGER_DIMENSION
public static final AbstractImageLoader.Options.ScalingPreference MATCH_TO_LARGER_DIMENSION
MATCH_TO_SMALLER_DIMENSION
public static final AbstractImageLoader.Options.ScalingPreference MATCH_TO_SMALLER_DIMENSION
values
public static AbstractImageLoader.Options.ScalingPreference[] values()
- Returns an array containing the constants of this enum type, in
the order they are declared. This method may be used to iterate
over the constants as follows:
for (AbstractImageLoader.Options.ScalingPreference c : AbstractImageLoader.Options.ScalingPreference.values())
System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in
the order they are declared
valueOf
public static AbstractImageLoader.Options.ScalingPreference valueOf(java.lang.String name)
- Returns the enum constant of this type with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this type. (Extraneous whitespace characters are
not permitted.)
- Parameters:
name
- the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant
with the specified name
java.lang.NullPointerException
- if the argument is null