forked from wonderpush/wonderpush-android-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimport-material-icons.sh
executable file
·154 lines (148 loc) · 2.96 KB
/
import-material-icons.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#!/bin/bash
# vim: ts=4 sts=4 sw=4 et
icons=(
"add"
"add alert"
"add circle"
"add circle outline"
"add shopping cart"
"alarm"
"alarm add"
"alarm off"
"arrow back"
"arrow downward"
"arrow drop down"
"arrow drop up"
"arrow forward"
"arrow upward"
"audiotrack"
"bookmark"
"cancel"
"chat bubble"
"chat bubble outline"
"check"
"check box"
"check circle"
"clear"
"credit card"
"delete"
"directions"
"do not disturb"
"edit"
"error"
"error outline"
"event"
"favorite"
"favorite border"
"feedback"
"forward"
"get app"
"gps fixed"
"help"
"info"
"keyboard arrow down"
"keyboard arrow left"
"keyboard arrow right"
"keyboard arrow up"
"loop"
"loyalty"
"mail"
"mail outline"
"map"
"menu"
"mic"
"mic off"
"more horiz"
"more vert"
"navigation"
"new releases"
"notifications"
"notifications off"
"pause"
"pause circle filled"
"pause circle outline"
"phone"
"photo camera"
"place"
"play arrow"
"play circle filled"
"play circle outline"
"question answer"
"redeem"
"refresh"
"remove"
"remove circle"
"remove circle outline"
"remove shopping cart"
"replay"
"reply"
"report"
"schedule"
"search"
"send"
"sentiment dissatisfied"
"sentiment neutral"
"sentiment satisfied"
"settings"
"share"
"shopping basket"
"shopping cart"
"star"
"star border"
"star half"
"stars"
"stop"
"thumb down"
"thumb up"
"thumbs up down"
"vibration"
"volume mute"
"volume off"
"volume up"
"warning"
"zoom in"
)
ICONS_REPO="../material-design-icons/"
cd "$(dirname "$0")"
# Ensure access to the repository
if ! [ -d "$ICONS_REPO" ]; then
echo "Cloning repository…"
git clone https://github.com/google/material-design-icons.git "$ICONS_REPO"
else
echo "Updating repository…"
cd "$ICONS_REPO"
git pull origin master
cd -
fi
echo
# Copy each listed icon and check for no matches
echo "Copying icons…"
for icon in "${icons[@]}"; do
id="${icon// /_}"
find "$ICONS_REPO" -type f -path '*/drawable-*' -name "ic_${id}_white_24dp.png" | (
nothing=1
while read file; do
nothing=0
density="${file#*drawable-}"
density="${density%%/*}"
cp "$file" "sdk/src/main/res/drawable-$density/ic_${id}_white_24dp.png"
done
if [ "$nothing" = "1" ]; then
echo ICON NOT FOUNT: $icon
fi
)
done
echo
# Find duplicates and print them
echo "Checking duplicates…"
find sdk/src/main/res/ -type f -path '*/drawable-*' | xargs md5sum | sort | while read line; do
md5="${line:0:32}"
file="${line:34}"
if [ "$md5" = "$prevmd5" ]; then
echo "DUPLICATE: $prevfile <=> $file"
else
prevmd5="$md5"
prevfile="$file"
fi
done
echo