Package icyllis.modernui.widget
Enum Class ImageView.ScaleType
- All Implemented Interfaces:
Serializable
,Comparable<ImageView.ScaleType>
,Constable
- Enclosing class:
ImageView
Options for scaling the bounds of an image to the bounds of this view.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionCenter the image in the view, but perform no scaling.Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or larger than the corresponding dimension of the view (minus padding).Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or less than the corresponding dimension of the view (minus padding).Compute a scale that will maintain the original src aspect ratio, but will also ensure that src fits entirely inside dst.Compute a scale that will maintain the original src aspect ratio, but will also ensure that src fits entirely inside dst.Compute a scale that will maintain the original src aspect ratio, but will also ensure that src fits entirely inside dst.Scale in X and Y independently, so that src matches dst exactly.Scale using the image matrix when drawing. -
Method Summary
Modifier and TypeMethodDescriptionstatic ImageView.ScaleType
Returns the enum constant of this class with the specified name.static ImageView.ScaleType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MATRIX
Scale using the image matrix when drawing. The image matrix can be set usingImageView.setImageMatrix(Matrix)
. -
FIT_XY
Scale in X and Y independently, so that src matches dst exactly. This may change the aspect ratio of the src. -
FIT_START
Compute a scale that will maintain the original src aspect ratio, but will also ensure that src fits entirely inside dst. At least one axis (X or Y) will fit exactly. START aligns the result to the left and top edges of dst. -
FIT_CENTER
Compute a scale that will maintain the original src aspect ratio, but will also ensure that src fits entirely inside dst. At least one axis (X or Y) will fit exactly. The result is centered inside dst. -
FIT_END
Compute a scale that will maintain the original src aspect ratio, but will also ensure that src fits entirely inside dst. At least one axis (X or Y) will fit exactly. END aligns the result to the right and bottom edges of dst. -
CENTER
Center the image in the view, but perform no scaling. -
CENTER_CROP
Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or larger than the corresponding dimension of the view (minus padding). The image is then centered in the view. -
CENTER_INSIDE
Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or less than the corresponding dimension of the view (minus padding). The image is then centered in the view.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-