Loading core/java/android/widget/ImageView.java +9 −2 Original line number Diff line number Diff line Loading @@ -687,8 +687,15 @@ public class ImageView extends View { return mDrawMatrix; } /** * Adds a transformation {@link Matrix} that is applied * to the view's drawable when it is drawn. Allows custom scaling, * translation, and perspective distortion. * * @param matrix the transformation parameters in matrix form */ public void setImageMatrix(Matrix matrix) { // collaps null and identity to just null // collapse null and identity to just null if (matrix != null && matrix.isIdentity()) { matrix = null; } Loading core/res/res/values/attrs.xml +15 −1 Original line number Diff line number Diff line Loading @@ -3505,15 +3505,29 @@ <!-- Sets a drawable as the content of this ImageView. --> <attr name="src" format="reference|color" /> <!-- Controls how the image should be resized or moved to match the size of this ImageView. --> of this ImageView. See {@link android.widget.ImageView.ScaleType} --> <attr name="scaleType"> <!-- Scale using the image matrix when drawing. See {@link android.widget.ImageView#setImageMatrix(Matrix)}. --> <enum name="matrix" value="0" /> <!-- Scale the image using {@link android.graphics.Matrix.ScaleToFit#FILL}. --> <enum name="fitXY" value="1" /> <!-- Scale the image using {@link android.graphics.Matrix.ScaleToFit#START}. --> <enum name="fitStart" value="2" /> <!-- Scale the image using {@link android.graphics.Matrix.ScaleToFit#CENTER}. --> <enum name="fitCenter" value="3" /> <!-- Scale the image using {@link android.graphics.Matrix.ScaleToFit#END}. --> <enum name="fitEnd" value="4" /> <!-- Center the image in the view, but perform no scaling. --> <enum name="center" value="5" /> <!-- Scale the image uniformly (maintain the image's aspect ratio) so 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. --> <enum name="centerCrop" value="6" /> <!-- 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. --> <enum name="centerInside" value="7" /> </attr> <!-- Set this to true if you want the ImageView to adjust its bounds Loading Loading
core/java/android/widget/ImageView.java +9 −2 Original line number Diff line number Diff line Loading @@ -687,8 +687,15 @@ public class ImageView extends View { return mDrawMatrix; } /** * Adds a transformation {@link Matrix} that is applied * to the view's drawable when it is drawn. Allows custom scaling, * translation, and perspective distortion. * * @param matrix the transformation parameters in matrix form */ public void setImageMatrix(Matrix matrix) { // collaps null and identity to just null // collapse null and identity to just null if (matrix != null && matrix.isIdentity()) { matrix = null; } Loading
core/res/res/values/attrs.xml +15 −1 Original line number Diff line number Diff line Loading @@ -3505,15 +3505,29 @@ <!-- Sets a drawable as the content of this ImageView. --> <attr name="src" format="reference|color" /> <!-- Controls how the image should be resized or moved to match the size of this ImageView. --> of this ImageView. See {@link android.widget.ImageView.ScaleType} --> <attr name="scaleType"> <!-- Scale using the image matrix when drawing. See {@link android.widget.ImageView#setImageMatrix(Matrix)}. --> <enum name="matrix" value="0" /> <!-- Scale the image using {@link android.graphics.Matrix.ScaleToFit#FILL}. --> <enum name="fitXY" value="1" /> <!-- Scale the image using {@link android.graphics.Matrix.ScaleToFit#START}. --> <enum name="fitStart" value="2" /> <!-- Scale the image using {@link android.graphics.Matrix.ScaleToFit#CENTER}. --> <enum name="fitCenter" value="3" /> <!-- Scale the image using {@link android.graphics.Matrix.ScaleToFit#END}. --> <enum name="fitEnd" value="4" /> <!-- Center the image in the view, but perform no scaling. --> <enum name="center" value="5" /> <!-- Scale the image uniformly (maintain the image's aspect ratio) so 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. --> <enum name="centerCrop" value="6" /> <!-- 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. --> <enum name="centerInside" value="7" /> </attr> <!-- Set this to true if you want the ImageView to adjust its bounds Loading