From d96fdbd0cdf968a587d99d86b9f7513e0ccdbaf8 Mon Sep 17 00:00:00 2001 From: Joseph Cooper Date: Fri, 3 Apr 2015 14:00:31 -0700 Subject: 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 --- core/java/android/widget/ImageView.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'core/java/android/widget/ImageView.java') diff --git a/core/java/android/widget/ImageView.java b/core/java/android/widget/ImageView.java index 041796b3e008..6d2f3686940d 100644 --- a/core/java/android/widget/ImageView.java +++ b/core/java/android/widget/ImageView.java @@ -687,12 +687,19 @@ 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; } - + // don't invalidate unless we're actually changing our matrix if (matrix == null && !mMatrix.isIdentity() || matrix != null && !mMatrix.equals(matrix)) { -- cgit v1.2.3