Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2efbe981 authored by Alan Viverette's avatar Alan Viverette
Browse files

Fix gradient drawable radius when specified as float, dimension

BUG: 18070756
Change-Id: I991ff792c376c9695a007f8f1187390ab5ff6e3c
parent d00e68c3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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. -->
+4 −1
Original line number Diff line number Diff line
@@ -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;