diff options
| -rw-r--r-- | core/res/res/values/attrs.xml | 2 | ||||
| -rw-r--r-- | graphics/java/android/graphics/drawable/GradientDrawable.java | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 747cb14..d988480 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -4911,7 +4911,7 @@ <!-- Y coordinate of the origin of the gradient within the shape. --> <attr name="centerY" format="float|fraction" /> <!-- Radius of the gradient, used only with radial gradient. --> - <attr name="gradientRadius" format="float|fraction" /> + <attr name="gradientRadius" format="float|fraction|dimension" /> </declare-styleable> <!-- Used to fill the shape of GradientDrawable with a solid color. --> diff --git a/graphics/java/android/graphics/drawable/GradientDrawable.java b/graphics/java/android/graphics/drawable/GradientDrawable.java index 689418b..0f15e47 100644 --- a/graphics/java/android/graphics/drawable/GradientDrawable.java +++ b/graphics/java/android/graphics/drawable/GradientDrawable.java @@ -1395,9 +1395,12 @@ public class GradientDrawable extends Drawable { } else { radiusType = RADIUS_TYPE_FRACTION; } - } else { + } else if (tv.type == TypedValue.TYPE_DIMENSION) { radius = tv.getDimension(r.getDisplayMetrics()); radiusType = RADIUS_TYPE_PIXELS; + } else { + radius = tv.getFloat(); + radiusType = RADIUS_TYPE_PIXELS; } st.mGradientRadius = radius; |
