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

Commit d96fdbd0 authored by Joseph Cooper's avatar Joseph Cooper
Browse files

Documents the ImageView.ScaleType attributes

Although the ImageView.ScaleType enum is documented, that
documentation was not reproduced in the xml attributes.  Copying the
documentation across should fill the previously empty 'Description'
column in
http://developer.android.com/reference/android/R.attr.html#scaleType
and
http://developer.android.com/reference/android/widget/ImageView.html#attr_android:scaleType

Also adds javadocs to ImageView.setImageMatrix(Matrix) because the
ScaleType documentation refers to it and it was also empty.

Change-Id: I7768549970eab2ebfe38cc4677a58dc91e104588
parent ecad2e2c
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
@@ -3504,15 +3504,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