Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 88dc5ba6 authored by Joseph Cooper's avatar Joseph Cooper Committed by Android (Google) Code Review
Browse files

Merge "Documents the ImageView.ScaleType attributes"

parents 3195b747 d96fdbd0
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -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;
        }
+15 −1
Original line number Diff line number Diff line
@@ -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