- Hello, if you are new to this library, you can ignore this. If you have used the
ShapeViewlibrary before, that is, versions below9.0, you need to adapt after upgrading to version9.0, otherwiseAndroid Studiowill report acompilation failederror. I apologize for this issue. The naming ofxmlattributes in lower versions was not very standardized. Now, in version9.0, it has been optimized. Although the cost of this change is relatively high, I will do it without hesitation. If you useShapeViewbut do not want to adapt, please do not upgrade the library version.
-
Modification
- Changed the attribute name
app:shape_strokeGradientColor, please useapp:shape_strokeGradientEndColorinstead
- Changed the attribute name
-
New Attributes
-
Added
app:shape_radiusInTopStartattribute -
Added
app:shape_radiusInTopEndattribute -
Added
app:shape_radiusInBottomStartattribute -
Added
app:shape_radiusInBottomEndattribute
-
-
Supplement Attribute Values
- Added several layout reverse direction attribute values for
app:shape_solidGradientOrientationandapp:shape_strokeGradientOrientationattributes
- Added several layout reverse direction attribute values for
<!-- Draw gradient from left to right (0 degrees) -->
<enum name="startToEnd" value="10" />
<!-- Draw gradient from right to left (180 degrees) -->
<enum name="endToStart" value="1800" />
<!-- Draw gradient from top left to bottom right (315 degrees) -->
<enum name="topStartToBottomEnd" value="3150" />
<!-- Draw gradient from bottom left to top right (45 degrees) -->
<enum name="bottomStartToTopEnd" value="450" />
<!-- Draw gradient from top right to bottom left (225 degrees) -->
<enum name="topEndToBottomStart" value="2250" />
<!-- Draw gradient from bottom right to top left (135 degrees) -->
<enum name="bottomEndToTopStart" value="1350" />-
Added
- Added
app:shape_strokeGradientOrientationattribute
- Added
-
Deleted
- Deleted
app:shape_useLevelattribute, reason: rarely used, if needed, please raise your voice
- Deleted
-
Modified
-
Changed the attribute name
app:shape, please useapp:shape_typeinstead -
Changed the attribute name
app:shape_topLeftRadius, please useapp:shape_radiusInTopLeftinstead -
Changed the attribute name
app:shape_topRightRadius, please useapp:shape_radiusInTopRightinstead -
Changed the attribute name
app:shape_bottomLeftRadius, please useapp:shape_radiusInBottomLeftinstead -
Changed the attribute name
app:shape_bottomRightRadius, please useapp:shape_radiusInBottomRightinstead -
Changed the attribute name
app:shape_startColor, please useapp:shape_solidGradientStartColorinstead -
Changed the attribute name
app:shape_centerColor, please useapp:shape_solidGradientCenterColorinstead -
Changed the attribute name
app:shape_endColor, please useapp:shape_solidGradientEndColorinstead -
Changed the attribute name
app:shape_gradientType, please useapp:shape_solidGradientTypeinstead -
Changed the attribute name
app:shape_centerX, please useapp:shape_solidGradientCenterXinstead -
Changed the attribute name
app:shape_centerY, please useapp:shape_solidGradientCenterYinstead -
Changed the attribute name
app:shape_gradientRadius, please useapp:shape_solidGradientRadiusinstead -
Changed the attribute name
app:shape_strokeWidth, please useapp:shape_strokeSizeinstead -
Changed the attribute name
app:shape_dashWidth, please useapp:shape_strokeDashSizeinstead -
Changed the attribute name
app:shape_dashGap, please useapp:shape_strokeDashGapinstead -
Changed the attribute name
app:shape_innerRadius, please useapp:shape_ringInnerRadiusSizeinstead -
Changed the attribute name
app:shape_innerRadiusRatio, please useapp:shape_ringInnerRadiusRatioinstead -
Changed the attribute name
app:shape_thickness, please useapp:shape_ringThicknessSizeinstead -
Changed the attribute name
app:shape_thicknessRatio, please useapp:shape_ringThicknessRatioinstead
-
-
Split
- Split the attribute
app:shape_angleintoapp:shape_solidGradientOrientationandapp:shape_strokeGradientOrientation. The previousapp:shape_angleattribute is equivalent to the currentapp:shape_solidGradientOrientationattribute. You can directly search and replace. Also, the value type has been changed. For specific values, please refer to the following:
- Split the attribute
<!-- Draw gradient from left to right (0 degrees) -->
<enum name="leftToRight" value="0" />
<!-- Draw gradient from right to left (180 degrees) -->
<enum name="rightToLeft" value="180" />
<!-- Draw gradient from bottom to top (90 degrees) -->
<enum name="bottomToTop" value="90" />
<!-- Draw gradient from top to bottom (270 degrees) -->
<enum name="topToBottom" value="270" />
<!-- Draw gradient from top left to bottom right (315 degrees) -->
<enum name="topLeftToBottomRight" value="315" />
<!-- Draw gradient from bottom left to top right (45 degrees) -->
<enum name="bottomLeftToTopRight" value="45" />
<!-- Draw gradient from top right to bottom left (225 degrees) -->
<enum name="topRightToBottomLeft" value="225" />
<!-- Draw gradient from bottom right to top left (135 degrees) -->
<enum name="bottomRightToTopLeft" value="135" />