Add docs for srcCompat
BUG: 29245059
Change-Id: Id428c3de5b1cd1eaefd939728880d43ac42add9c
diff --git a/v7/appcompat/res/values/attrs.xml b/v7/appcompat/res/values/attrs.xml
index 1980bb7..eeb5f7d 100644
--- a/v7/appcompat/res/values/attrs.xml
+++ b/v7/appcompat/res/values/attrs.xml
@@ -1057,7 +1057,8 @@
<declare-styleable name="AppCompatImageView">
<attr name="android:src"/>
- <!-- TODO -->
+ <!-- Sets a drawable as the content of this ImageView. Allows the use of vector drawable
+ when running on older versions of the platform. -->
<attr name="srcCompat" format="reference" />
</declare-styleable>
diff --git a/v7/appcompat/src/android/support/v7/widget/AppCompatImageView.java b/v7/appcompat/src/android/support/v7/widget/AppCompatImageView.java
index b8b1b2f..bdfc7ca 100644
--- a/v7/appcompat/src/android/support/v7/widget/AppCompatImageView.java
+++ b/v7/appcompat/src/android/support/v7/widget/AppCompatImageView.java
@@ -65,6 +65,15 @@
mImageHelper.loadFromAttributes(attrs, defStyleAttr);
}
+ /**
+ * Sets a drawable as the content of this ImageView.
+ *
+ * <p>Allows the use of vector drawables when running on older versions of the platform.</p>
+ *
+ * @param resId the resource identifier of the drawable
+ * @see ImageView#setImageResource(int)
+ * @attr ref R.styleable#AppCompatImageView_srcCompat
+ */
@Override
public void setImageResource(@DrawableRes int resId) {
// Intercept this call and instead retrieve the Drawable via the image helper