|
| 1 | +# About Attribute Adaptation Issues |
| 2 | + |
| 3 | +* Hello, if you are new to this library, you can ignore this. If you have used the `ShapeView` library before, that is, versions below `9.0`, you need to adapt after upgrading to version `9.0`, otherwise `Android Studio` will report a `compilation failed` error. I apologize for this issue. The naming of `xml` attributes in lower versions was not very standardized. Now, in version `9.0`, it has been optimized. Although the cost of this change is relatively high, I will do it without hesitation. If you use `ShapeView` but do not want to adapt, please do not upgrade the library version. |
| 4 | + |
| 5 | +#### Adaptation Plan for Upgrading from Version 9.2 to 9.3 |
| 6 | + |
| 7 | +* Modification |
| 8 | + |
| 9 | + * Changed the attribute name `app:shape_strokeGradientColor`, please use `app:shape_strokeGradientEndColor` instead |
| 10 | + |
| 11 | +#### Adaptation Plan for Upgrading from Version 9.0 to 9.2 |
| 12 | + |
| 13 | +* New Attributes |
| 14 | + |
| 15 | + * Added `app:shape_radiusInTopStart` attribute |
| 16 | + |
| 17 | + * Added `app:shape_radiusInTopEnd` attribute |
| 18 | + |
| 19 | + * Added `app:shape_radiusInBottomStart` attribute |
| 20 | + |
| 21 | + * Added `app:shape_radiusInBottomEnd` attribute |
| 22 | + |
| 23 | +* Supplement Attribute Values |
| 24 | + |
| 25 | + * Added several layout reverse direction attribute values for `app:shape_solidGradientOrientation` and `app:shape_strokeGradientOrientation` attributes |
| 26 | + |
| 27 | +```xml |
| 28 | +<!-- Draw gradient from left to right (0 degrees) --> |
| 29 | +<enum name="startToEnd" value="10" /> |
| 30 | + |
| 31 | +<!-- Draw gradient from right to left (180 degrees) --> |
| 32 | +<enum name="endToStart" value="1800" /> |
| 33 | + |
| 34 | +<!-- Draw gradient from top left to bottom right (315 degrees) --> |
| 35 | +<enum name="topStartToBottomEnd" value="3150" /> |
| 36 | + |
| 37 | +<!-- Draw gradient from bottom left to top right (45 degrees) --> |
| 38 | +<enum name="bottomStartToTopEnd" value="450" /> |
| 39 | + |
| 40 | +<!-- Draw gradient from top right to bottom left (225 degrees) --> |
| 41 | +<enum name="topEndToBottomStart" value="2250" /> |
| 42 | + |
| 43 | +<!-- Draw gradient from bottom right to top left (135 degrees) --> |
| 44 | +<enum name="bottomEndToTopStart" value="1350" /> |
| 45 | +``` |
| 46 | + |
| 47 | +#### Adaptation Plan for Upgrading from Version 8.5 to 9.0 |
| 48 | + |
| 49 | +* Added |
| 50 | + |
| 51 | + * Added `app:shape_strokeGradientOrientation` attribute |
| 52 | + |
| 53 | +* Deleted |
| 54 | + |
| 55 | + * Deleted `app:shape_useLevel` attribute, reason: rarely used, if needed, please raise your voice |
| 56 | + |
| 57 | +* Modified |
| 58 | + |
| 59 | + * Changed the attribute name `app:shape`, please use `app:shape_type` instead |
| 60 | + |
| 61 | + * Changed the attribute name `app:shape_topLeftRadius`, please use `app:shape_radiusInTopLeft` instead |
| 62 | + |
| 63 | + * Changed the attribute name `app:shape_topRightRadius`, please use `app:shape_radiusInTopRight` instead |
| 64 | + |
| 65 | + * Changed the attribute name `app:shape_bottomLeftRadius`, please use `app:shape_radiusInBottomLeft` instead |
| 66 | + |
| 67 | + * Changed the attribute name `app:shape_bottomRightRadius`, please use `app:shape_radiusInBottomRight` instead |
| 68 | + |
| 69 | + * Changed the attribute name `app:shape_startColor`, please use `app:shape_solidGradientStartColor` instead |
| 70 | + |
| 71 | + * Changed the attribute name `app:shape_centerColor`, please use `app:shape_solidGradientCenterColor` instead |
| 72 | + |
| 73 | + * Changed the attribute name `app:shape_endColor`, please use `app:shape_solidGradientEndColor` instead |
| 74 | + |
| 75 | + * Changed the attribute name `app:shape_gradientType`, please use `app:shape_solidGradientType` instead |
| 76 | + |
| 77 | + * Changed the attribute name `app:shape_centerX`, please use `app:shape_solidGradientCenterX` instead |
| 78 | + |
| 79 | + * Changed the attribute name `app:shape_centerY`, please use `app:shape_solidGradientCenterY` instead |
| 80 | + |
| 81 | + * Changed the attribute name `app:shape_gradientRadius`, please use `app:shape_solidGradientRadius` instead |
| 82 | + |
| 83 | + * Changed the attribute name `app:shape_strokeWidth`, please use `app:shape_strokeSize` instead |
| 84 | + |
| 85 | + * Changed the attribute name `app:shape_dashWidth`, please use `app:shape_strokeDashSize` instead |
| 86 | + |
| 87 | + * Changed the attribute name `app:shape_dashGap`, please use `app:shape_strokeDashGap` instead |
| 88 | + |
| 89 | + * Changed the attribute name `app:shape_innerRadius`, please use `app:shape_ringInnerRadiusSize` instead |
| 90 | + |
| 91 | + * Changed the attribute name `app:shape_innerRadiusRatio`, please use `app:shape_ringInnerRadiusRatio` instead |
| 92 | + |
| 93 | + * Changed the attribute name `app:shape_thickness`, please use `app:shape_ringThicknessSize` instead |
| 94 | + |
| 95 | + * Changed the attribute name `app:shape_thicknessRatio`, please use `app:shape_ringThicknessRatio` instead |
| 96 | + |
| 97 | +* Split |
| 98 | + |
| 99 | + * Split the attribute `app:shape_angle` into `app:shape_solidGradientOrientation` and `app:shape_strokeGradientOrientation`. The previous `app:shape_angle` attribute is equivalent to the current `app:shape_solidGradientOrientation` attribute. You can directly search and replace. Also, the value type has been changed. For specific values, please refer to the following: |
| 100 | + |
| 101 | +```xml |
| 102 | +<!-- Draw gradient from left to right (0 degrees) --> |
| 103 | +<enum name="leftToRight" value="0" /> |
| 104 | +<!-- Draw gradient from right to left (180 degrees) --> |
| 105 | +<enum name="rightToLeft" value="180" /> |
| 106 | +<!-- Draw gradient from bottom to top (90 degrees) --> |
| 107 | +<enum name="bottomToTop" value="90" /> |
| 108 | +<!-- Draw gradient from top to bottom (270 degrees) --> |
| 109 | +<enum name="topToBottom" value="270" /> |
| 110 | + |
| 111 | +<!-- Draw gradient from top left to bottom right (315 degrees) --> |
| 112 | +<enum name="topLeftToBottomRight" value="315" /> |
| 113 | +<!-- Draw gradient from bottom left to top right (45 degrees) --> |
| 114 | +<enum name="bottomLeftToTopRight" value="45" /> |
| 115 | +<!-- Draw gradient from top right to bottom left (225 degrees) --> |
| 116 | +<enum name="topRightToBottomLeft" value="225" /> |
| 117 | +<!-- Draw gradient from bottom right to top left (135 degrees) --> |
| 118 | +<enum name="bottomRightToTopLeft" value="135" /> |
| 119 | +``` |
0 commit comments