diff options
| author | 2015-06-12 10:27:44 +0100 | |
|---|---|---|
| committer | 2015-06-12 17:21:31 +0100 | |
| commit | 96a443b58d9c9849c846750657f959e3743bc5ed (patch) | |
| tree | f75c161c4cb8e7178e21405d86bb373de60f6ffe | |
| parent | 5c82d2cc17df9774e677f6bab9cb52659fc2b56d (diff) | |
Clarify Drawable.getOpacity() docs
Docs for translucent-vs-transparent-vs-opaque were confusing, especially since
the definition for those constants in PixelFormat are not the same as how they're
actually used in Drawable. This fix simply adds clarifying text to the method
comment for getOpacity().
Issue #21158891 Better document Drawable#getOpacity
Change-Id: I94725592f85e5d7874e3a3ac1c5bab969163fbf0
| -rw-r--r-- | graphics/java/android/graphics/drawable/Drawable.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/drawable/Drawable.java b/graphics/java/android/graphics/drawable/Drawable.java index e8e4664fbe35..532c88857bff 100644 --- a/graphics/java/android/graphics/drawable/Drawable.java +++ b/graphics/java/android/graphics/drawable/Drawable.java @@ -809,6 +809,14 @@ public abstract class Drawable { * {@link android.graphics.PixelFormat#TRANSPARENT}, or * {@link android.graphics.PixelFormat#OPAQUE}. * + * <p>An OPAQUE drawable is one that draws all all content within its bounds, completely + * covering anything behind the drawable. A TRANSPARENT drawable is one that draws nothing + * within its bounds, allowing everything behind it to show through. A TRANSLUCENT drawable + * is a drawable in any other state, where the drawable will draw some, but not all, + * of the content within its bounds and at least some content behind the drawable will + * be visible. If the visibility of the drawable's contents cannot be determined, the + * safest/best return value is TRANSLUCENT. + * * <p>Generally a Drawable should be as conservative as possible with the * value it returns. For example, if it contains multiple child drawables * and only shows one of them at a time, if only one of the children is |