Created
October 21, 2014 10:24
-
-
Save crakaC/3cbb25bc2c250c1602b6 to your computer and use it in GitHub Desktop.
マテリアルデザインのアイコン( https://github.com/google/material-design-icons )を簡単に使えるようにしたかった.icon.txtのように使うアイコンを指定して,./icon_picker.shを走らせると,iconsディレクトリ内にAndroid用のリソースが抽出できる(白アイコンだけ).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
navigation/refresh | |
content/add | |
action/delete | |
action/get_app | |
image/rotate_left | |
image/rotate_right | |
content/reply | |
content/reply_all | |
av/repeat | |
toggle/star | |
toggle/star_outline | |
action/question_answer | |
action/open_in_browser | |
action/open_in_new | |
action/home | |
communication/email | |
action/list | |
social/group | |
action/settings | |
content/send | |
content/create | |
editor/insert_photo | |
image/camera_alt | |
navigation/expand_more | |
navigation/expand_less | |
social/person_add | |
action/verified_user | |
action/lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ICON_FILE=icon.txt | |
SRC_DIR=material-design-icons | |
DST_DIR=icons | |
if [ -e $DST_DIR ]; then | |
rm -r $DST_DIR | |
fi | |
while read target; do | |
echo $target | |
param=(`echo $target | tr -s '/' ' '`) | |
for file_path in `find $SRC_DIR -type f | grep drawable | grep ${param[0]} | grep ic_${param[1]}_white `; do | |
file_name=${file_path##*/} | |
dir_path=${file_path%/ic_*} | |
dpi_dir=${dir_path##*/} | |
if [ ! -e $DST_DIR/$dpi_dir ]; then | |
mkdir -p $DST_DIR/$dpi_dir | |
fi | |
echo "copy $file_path" | |
cp $file_path $DST_DIR/$dpi_dir/$file_name | |
done | |
done < $ICON_FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment