summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nader Jawad <njawad@google.com> 2018-11-08 15:53:47 -0800
committer Nader Jawad <njawad@google.com> 2018-11-08 15:53:47 -0800
commitfc063e9c227e4fe460b32d6bdffab65e8031e34a (patch)
tree3e8955811c569b9bcf72613676de759e76a7f441
parent8ad9ef4aa9ac29823b17c67b343da4e96efcbb1a (diff)
Updated ColorDrawable setAlpha/getAlpha documentation
Updated documentation on ColorDrawable to clarify that the alpha value provided is combined with the color's already existing alpha value instead of overwriting it. Bug: 119004459 Test: Build and boots Change-Id: Id62462c4ac7d2f46cdc3236876f7e0711fbc4c16
-rw-r--r--graphics/java/android/graphics/drawable/ColorDrawable.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/graphics/java/android/graphics/drawable/ColorDrawable.java b/graphics/java/android/graphics/drawable/ColorDrawable.java
index 18b41fa22065..3c449166d9d5 100644
--- a/graphics/java/android/graphics/drawable/ColorDrawable.java
+++ b/graphics/java/android/graphics/drawable/ColorDrawable.java
@@ -149,9 +149,13 @@ public class ColorDrawable extends Drawable {
}
/**
- * Returns the alpha value of this drawable's color.
+ * Returns the alpha value of this drawable's color. Note this may not be the same alpha value
+ * provided in {@link Drawable#setAlpha(int)}. Instead this will return the alpha of the color
+ * combined with the alpha provided by setAlpha
*
* @return A value between 0 and 255.
+ *
+ * @see ColorDrawable#setAlpha(int)
*/
@Override
public int getAlpha() {
@@ -159,7 +163,9 @@ public class ColorDrawable extends Drawable {
}
/**
- * Sets the color's alpha value.
+ * Applies the given alpha to the underlying color. Note if the color already has
+ * an alpha applied to it, this will apply this alpha to the existing value instead of
+ * overwriting it.
*
* @param alpha The alpha value to set, between 0 and 255.
*/