Skip to content

Commit 8bf428e

Browse files
committed
refactor previews to use color definitions
1 parent 90c34d0 commit 8bf428e

10 files changed

+229
-189
lines changed

app/src/main/res/animator/fill_color_white_to_blue.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<objectAnimator
44
android:duration="250"
55
android:propertyName="fillColor"
6-
android:valueFrom="#fff"
7-
android:valueTo="#2b88cc"
6+
android:valueFrom="@color/white"
7+
android:valueTo="@color/blue"
88
android:valueType="colorType" />
99
</set>

app/src/main/res/animator/fill_color_white_to_orange.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<objectAnimator
44
android:duration="250"
55
android:propertyName="fillColor"
6-
android:valueFrom="#fff"
7-
android:valueTo="#ce6d29"
6+
android:valueFrom="@color/white"
7+
android:valueTo="@color/orange"
88
android:valueType="colorType" />
99
</set>

app/src/main/res/animator/stroke_color_black_to_white.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<objectAnimator
44
android:duration="250"
55
android:propertyName="strokeColor"
6-
android:valueFrom="#000"
7-
android:valueTo="#fff"
6+
android:valueFrom="@color/black"
7+
android:valueTo="@color/white"
88
android:valueType="colorType" />
99
</set>

app/src/main/res/animator/stroke_color_white_to_blue.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<objectAnimator
44
android:duration="250"
55
android:propertyName="strokeColor"
6-
android:valueFrom="#fff"
7-
android:valueTo="#2b88cc"
6+
android:valueFrom="@color/white"
7+
android:valueTo="@color/blue"
88
android:valueType="colorType" />
99
</set>

app/src/main/res/animator/stroke_color_white_to_orange.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<objectAnimator
44
android:duration="250"
55
android:propertyName="strokeColor"
6-
android:valueFrom="#fff"
7-
android:valueTo="#ce6d29"
6+
android:valueFrom="@color/white"
7+
android:valueTo="@color/orange"
88
android:valueType="colorType" />
99
</set>

app/src/main/res/drawable/group_preview.xml

Lines changed: 63 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -3,119 +3,130 @@
33
android:height="108dp"
44
android:viewportWidth="108"
55
android:viewportHeight="108">
6-
<group>
6+
<group
7+
android:pivotX="13"
8+
android:pivotY="13"
9+
android:rotation="270"
10+
android:translateX="20"
11+
android:translateY="8">
712
<path
8-
android:name="blue_circle_fill"
9-
android:fillColor="#fff"
10-
android:pathData="M75,87m8.5,-0a8.5,8.5 0,1 1,-17 -0a8.5,8.5 0,1 1,17 -0" />
13+
android:name="orange_circle_fill"
14+
android:fillColor="@color/white"
15+
android:pathData="M13,13m-8.5,0a8.5,8.5 0,1 1,17 0a8.5,8.5 0,1 1,-17 0" />
1116
<path
12-
android:name="blue_circle_stroke"
13-
android:pathData="M86.85,87a11.85,11.85 110.66,1 0,-23.7 -0a11.85,11.85 110.66,1 0,23.7 -0z"
17+
android:name="orange_circle_stroke"
18+
android:pathData="M1.15,13a11.85,11.85 0,1 0,23.7 0a11.85,11.85 0,1 0,-23.7 0z"
1419
android:strokeWidth="2.3"
15-
android:strokeColor="#fff"
16-
android:strokeLineCap="round"
17-
android:strokeLineJoin="round" />
20+
android:strokeColor="@color/white" />
1821
<path
1922
android:name="circle_arc"
20-
android:pathData="m69.8,81.8a7.35,7.35 0,0 1,10.39 -0,7.35 7.35,45 0,1 -0,10.39"
23+
android:pathData="m18.197,18.197a7.35,7.35 0,0 1,-10.395 0,7.35 7.35,0 0,1 0,-10.395"
2124
android:strokeWidth="2.3"
2225
android:strokeAlpha="0.3"
23-
android:strokeColor="#000"
26+
android:strokeColor="@color/black"
2427
android:strokeLineCap="round"
2528
android:strokeLineJoin="round" />
2629
<path
2730
android:name="circle_arc"
28-
android:pathData="m83.38,95.38a11.85,11.85 110.66,0 1,-11.45 3.07,11.85 11.85,110.66 0,1 -8.38,-8.38 11.85,11.85 110.66,0 1,3.07 -11.45"
31+
android:pathData="M4.621,4.621A11.85,11.85 0,0 1,16.067 1.554,11.85 11.85,0 0,1 24.446,9.933 11.85,11.85 0,0 1,21.379 21.379"
2932
android:strokeWidth="2.3"
3033
android:strokeAlpha="0.3"
31-
android:strokeColor="#000"
34+
android:strokeColor="@color/black"
3235
android:strokeLineCap="round"
3336
android:strokeLineJoin="round" />
3437
</group>
35-
<group>
38+
<group
39+
android:pivotX="13"
40+
android:pivotY="13"
41+
android:translateX="62"
42+
android:translateY="28">
3643
<path
37-
android:name="blue_circle_fill"
38-
android:fillColor="#fff"
39-
android:pathData="M33,67m-0,-8.5a8.5,8.5 0,1 1,-0 17a8.5,8.5 0,1 1,-0 -17" />
44+
android:name="orange_circle_fill"
45+
android:fillColor="@color/white"
46+
android:pathData="M13,13m-8.5,0a8.5,8.5 0,1 1,17 0a8.5,8.5 0,1 1,-17 0" />
4047
<path
41-
android:name="blue_circle_stroke"
42-
android:pathData="M33,55.15a11.85,11.85 110.66,1 0,-0 23.7a11.85,11.85 110.66,1 0,-0 -23.7z"
48+
android:name="orange_circle_stroke"
49+
android:pathData="M1.15,13a11.85,11.85 0,1 0,23.7 0a11.85,11.85 0,1 0,-23.7 0z"
4350
android:strokeWidth="2.3"
44-
android:strokeColor="#fff"
45-
android:strokeLineCap="round"
46-
android:strokeLineJoin="round" />
51+
android:strokeColor="@color/white" />
4752
<path
4853
android:name="circle_arc"
49-
android:pathData="m27.8,72.2a7.35,7.35 135,0 1,-0 -10.39,7.35 7.35,0 0,1 10.39,0"
54+
android:pathData="m18.197,18.197a7.35,7.35 0,0 1,-10.395 0,7.35 7.35,0 0,1 0,-10.395"
5055
android:strokeWidth="2.3"
5156
android:strokeAlpha="0.3"
52-
android:strokeColor="#000"
57+
android:strokeColor="@color/black"
5358
android:strokeLineCap="round"
5459
android:strokeLineJoin="round" />
5560
<path
5661
android:name="circle_arc"
57-
android:pathData="m41.38,58.62a11.85,11.85 110.66,0 1,3.07 11.45,11.85 11.85,110.66 0,1 -8.38,8.38 11.85,11.85 110.66,0 1,-11.45 -3.07"
62+
android:pathData="M4.621,4.621A11.85,11.85 0,0 1,16.067 1.554,11.85 11.85,0 0,1 24.446,9.933 11.85,11.85 0,0 1,21.379 21.379"
5863
android:strokeWidth="2.3"
5964
android:strokeAlpha="0.3"
60-
android:strokeColor="#000"
65+
android:strokeColor="@color/black"
6166
android:strokeLineCap="round"
6267
android:strokeLineJoin="round" />
6368
</group>
64-
<group>
69+
<group
70+
android:pivotX="13"
71+
android:pivotY="13"
72+
android:rotation="90"
73+
android:translateX="20"
74+
android:translateY="54">
6575
<path
66-
android:name="orange_circle_fill"
67-
android:fillColor="#fff"
68-
android:pathData="M75,41m-8.5,0a8.5,8.5 0,1 1,17 0a8.5,8.5 0,1 1,-17 0" />
76+
android:name="blue_circle_fill"
77+
android:fillColor="@color/white"
78+
android:pathData="M13,13m-8.5,0a8.5,8.5 0,1 1,17 0a8.5,8.5 0,1 1,-17 0" />
6979
<path
70-
android:name="orange_circle_stroke"
71-
android:pathData="M63.15,41a11.85,11.85 110.66,1 0,23.7 0a11.85,11.85 110.66,1 0,-23.7 0z"
80+
android:name="blue_circle_stroke"
81+
android:pathData="M1.15,13a11.85,11.85 0,1 0,23.7 0a11.85,11.85 0,1 0,-23.7 0z"
7282
android:strokeWidth="2.3"
73-
android:strokeColor="#fff"
74-
android:strokeLineCap="round"
75-
android:strokeLineJoin="round" />
83+
android:strokeColor="@color/white" />
7684
<path
7785
android:name="circle_arc"
78-
android:pathData="m80.2,46.2a7.35,7.35 0,0 1,-10.39 0,7.35 7.35,0 0,1 0,-10.39"
86+
android:pathData="m18.197,18.197a7.35,7.35 0,0 1,-10.395 0,7.35 7.35,0 0,1 0,-10.395"
7987
android:strokeWidth="2.3"
8088
android:strokeAlpha="0.3"
81-
android:strokeColor="#000"
89+
android:strokeColor="@color/black"
8290
android:strokeLineCap="round"
8391
android:strokeLineJoin="round" />
8492
<path
8593
android:name="circle_arc"
86-
android:pathData="m66.62,32.62a11.85,11.85 110.66,0 1,11.45 -3.07,11.85 11.85,110.66 0,1 8.38,8.38 11.85,11.85 110.66,0 1,-3.07 11.45"
94+
android:pathData="M4.621,4.621A11.85,11.85 0,0 1,16.067 1.554,11.85 11.85,0 0,1 24.446,9.933 11.85,11.85 0,0 1,21.379 21.379"
8795
android:strokeWidth="2.3"
8896
android:strokeAlpha="0.3"
89-
android:strokeColor="#000"
97+
android:strokeColor="@color/black"
9098
android:strokeLineCap="round"
9199
android:strokeLineJoin="round" />
92100
</group>
93-
<group>
101+
<group
102+
android:pivotX="13"
103+
android:pivotY="13"
104+
android:rotation="180"
105+
android:translateX="62"
106+
android:translateY="74">
94107
<path
95-
android:name="orange_circle_fill"
96-
android:fillColor="#fff"
97-
android:pathData="M33,21m0,8.5a8.5,8.5 0,1 1,0 -17a8.5,8.5 0,1 1,0 17" />
108+
android:name="blue_circle_fill"
109+
android:fillColor="@color/white"
110+
android:pathData="M13,13m-8.5,0a8.5,8.5 0,1 1,17 0a8.5,8.5 0,1 1,-17 0" />
98111
<path
99-
android:name="orange_circle_stroke"
100-
android:pathData="M33,32.85a11.85,11.85 110.66,1 0,0 -23.7a11.85,11.85 110.66,1 0,0 23.7z"
112+
android:name="blue_circle_stroke"
113+
android:pathData="M1.15,13a11.85,11.85 0,1 0,23.7 0a11.85,11.85 0,1 0,-23.7 0z"
101114
android:strokeWidth="2.3"
102-
android:strokeColor="#fff"
103-
android:strokeLineCap="round"
104-
android:strokeLineJoin="round" />
115+
android:strokeColor="@color/white" />
105116
<path
106117
android:name="circle_arc"
107-
android:pathData="m38.2,15.8a7.35,7.35 135,0 1,0 10.39,7.35 7.35,45 0,1 -10.39,-0"
118+
android:pathData="m18.197,18.197a7.35,7.35 0,0 1,-10.395 0,7.35 7.35,0 0,1 0,-10.395"
108119
android:strokeWidth="2.3"
109120
android:strokeAlpha="0.3"
110-
android:strokeColor="#000"
121+
android:strokeColor="@color/black"
111122
android:strokeLineCap="round"
112123
android:strokeLineJoin="round" />
113124
<path
114125
android:name="circle_arc"
115-
android:pathData="m24.62,29.38a11.85,11.85 110.66,0 1,-3.07 -11.45,11.85 11.85,110.66 0,1 8.38,-8.38 11.85,11.85 110.66,0 1,11.45 3.07"
126+
android:pathData="M4.621,4.621A11.85,11.85 0,0 1,16.067 1.554,11.85 11.85,0 0,1 24.446,9.933 11.85,11.85 0,0 1,21.379 21.379"
116127
android:strokeWidth="2.3"
117128
android:strokeAlpha="0.3"
118-
android:strokeColor="#000"
129+
android:strokeColor="@color/black"
119130
android:strokeLineCap="round"
120131
android:strokeLineJoin="round" />
121132
</group>

0 commit comments

Comments
 (0)