am ed89e452: am 7c133e19: Merge "Fix gradient drawable radius when specified as float, dimension" into lmp-mr1-dev
* commit 'ed89e45253ffded993ed88cd33457f45dbd6a32b': Fix gradient drawable radius when specified as float, dimension
This commit is contained in:
@@ -4911,7 +4911,7 @@
|
|||||||
<!-- Y coordinate of the origin of the gradient within the shape. -->
|
<!-- Y coordinate of the origin of the gradient within the shape. -->
|
||||||
<attr name="centerY" format="float|fraction" />
|
<attr name="centerY" format="float|fraction" />
|
||||||
<!-- Radius of the gradient, used only with radial gradient. -->
|
<!-- Radius of the gradient, used only with radial gradient. -->
|
||||||
<attr name="gradientRadius" format="float|fraction" />
|
<attr name="gradientRadius" format="float|fraction|dimension" />
|
||||||
</declare-styleable>
|
</declare-styleable>
|
||||||
|
|
||||||
<!-- Used to fill the shape of GradientDrawable with a solid color. -->
|
<!-- Used to fill the shape of GradientDrawable with a solid color. -->
|
||||||
|
|||||||
@@ -1395,9 +1395,12 @@ public class GradientDrawable extends Drawable {
|
|||||||
} else {
|
} else {
|
||||||
radiusType = RADIUS_TYPE_FRACTION;
|
radiusType = RADIUS_TYPE_FRACTION;
|
||||||
}
|
}
|
||||||
} else {
|
} else if (tv.type == TypedValue.TYPE_DIMENSION) {
|
||||||
radius = tv.getDimension(r.getDisplayMetrics());
|
radius = tv.getDimension(r.getDisplayMetrics());
|
||||||
radiusType = RADIUS_TYPE_PIXELS;
|
radiusType = RADIUS_TYPE_PIXELS;
|
||||||
|
} else {
|
||||||
|
radius = tv.getFloat();
|
||||||
|
radiusType = RADIUS_TYPE_PIXELS;
|
||||||
}
|
}
|
||||||
|
|
||||||
st.mGradientRadius = radius;
|
st.mGradientRadius = radius;
|
||||||
|
|||||||
Reference in New Issue
Block a user