summaryrefslogtreecommitdiff
path: root/core/java/android/widget/ImageView.java
diff options
context:
space:
mode:
authorJoseph Cooper <josephcooper@google.com>2015-04-03 14:00:31 -0700
committerJoseph Cooper <josephcooper@google.com>2015-04-03 15:16:38 -0700
commitd96fdbd0cdf968a587d99d86b9f7513e0ccdbaf8 (patch)
tree47ea5618d10bfe46d0d6e7351f28b9f31e7ceb4d /core/java/android/widget/ImageView.java
parentecad2e2c344651fa9538f113d908a405acbc03b6 (diff)
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
Diffstat (limited to 'core/java/android/widget/ImageView.java')
-rw-r--r--core/java/android/widget/ImageView.java11
1 files changed, 9 insertions, 2 deletions
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)) {