Better docs for ImageView legacy tint
Bug: 30283225
Change-Id: Ic748c2cc341edf44aed0202aa55a57584bd928c1
diff --git a/core/java/android/widget/ImageView.java b/core/java/android/widget/ImageView.java
index 222a040..184544d 100644
--- a/core/java/android/widget/ImageView.java
+++ b/core/java/android/widget/ImageView.java
@@ -545,6 +545,13 @@
* Subsequent calls to {@link #setImageDrawable(Drawable)} will automatically
* mutate the drawable and apply the specified tint and tint mode using
* {@link Drawable#setTintList(ColorStateList)}.
+ * <p>
+ * <em>Note:</em> The default tint mode used by this setter is NOT
+ * consistent with the default tint mode used by the
+ * {@link android.R.styleable#ImageView_tint android:tint}
+ * attribute. If the {@code android:tint} attribute is specified, the
+ * default tint mode will be set to {@link PorterDuff.Mode#SRC_ATOP} to
+ * ensure consistency with earlier versions of the platform.
*
* @param tint the tint to apply, may be {@code null} to clear tint
*
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index a70c4fd..3f889f9 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -3790,7 +3790,10 @@
<!-- An optional argument to supply a maximum height for this view.
See {see android.widget.ImageView#setMaxHeight} for details. -->
<attr name="maxHeight" format="dimension" />
- <!-- Set a tinting color for the image. By default, the tint will blend using SRC_ATOP mode. -->
+ <!-- The tinting color for the image. By default, the tint will blend using SRC_ATOP mode.
+ Please note that for compatibility reasons, this is NOT consistent with the default
+ SRC_IN tint mode used by {@link android.widget.ImageView#setImageTintList} and by
+ similar tint attributes on other views. -->
<attr name="tint" format="color" />
<!-- If true, the image view will be baseline aligned with based on its
bottom edge. -->