├── README.md ├── aid.sh └── icon_list.txt /README.md: -------------------------------------------------------------------------------- 1 | Android Icon Deployment 2 | ======================= 3 | 4 | 5 | "aid.sh" makes it easy to deploy the material icon to your Android Studio project. 6 | 7 | You can choose the icon from https://google.github.io/material-design-icons/ 8 | 9 | 10 | Prerequisites 11 | ------------- 12 | 13 | * **[Inkscape][1]** is professional quality vector graphics software. 14 | 15 | Usage 16 | ===== 17 | 18 | aid.sh [-c color] [-p /path/to/android-studio-project] icon_name 19 | 20 | You can omit project path if you execute "aid.sh" in Android project root where you want to put the icon. 21 | 22 | 23 | Example 24 | ------- 25 | 26 | $ aid.sh -c red -p /path/to/android-studio-project done 27 | 28 | 29 | Licence 30 | ======= 31 | 32 | Copyright 2014 Takashi Ishibashi 33 | 34 | Licensed under the Apache License, Version 2.0 (the "License"); 35 | you may not use this file except in compliance with the License. 36 | You may obtain a copy of the License at 37 | 38 | http://www.apache.org/licenses/LICENSE-2.0 39 | 40 | Unless required by applicable law or agreed to in writing, software 41 | distributed under the License is distributed on an "AS IS" BASIS, 42 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 43 | See the License for the specific language governing permissions and 44 | limitations under the License. 45 | 46 | 47 | [1]: https://inkscape.org/en/ 48 | -------------------------------------------------------------------------------- /aid.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | 4 | # Copyright 2014 Takashi Ishibashi 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | 18 | 19 | SRC='https://google.github.io/material-design-icons/' 20 | MATERIALS_HTML='/tmp/.materials' 21 | ICON_LIST='/tmp/.icon_list' 22 | RES='app/src/main/res' 23 | DRAWABLE="${RES}/drawable" 24 | 25 | INKSCAPE=`which inkscape` 26 | CURL=`which curl` 27 | MV=`which mv` 28 | PERL=`which perl` 29 | GREP=`which grep` 30 | SED=`which sed` 31 | RM=`which rm` 32 | 33 | 34 | usage(){ 35 | echo "Usage: ./aid.sh [-c color] [-p project_dir] icon_name" 1>&2 36 | echo 'Example: ./aid.sh -c white -p project/path done' 1>&2 37 | exit 1 38 | } 39 | 40 | check_dir(){ 41 | local PROJECT_DIR=$(cd $1; pwd) 42 | if [ ! -e ${PROJECT_DIR}/${DRAWABLE} ]; then 43 | echo "Error: wrong parameter $1" 1>&2 44 | usage 45 | exit 1 46 | fi 47 | } 48 | 49 | if [ -z $INKSCAPE ]; then 50 | echo "Please install inkscape" 51 | exit 1 52 | fi 53 | 54 | if [ -z $CURL ]; then 55 | echo "Please install curl" 56 | exit 1 57 | fi 58 | 59 | PROJECT_DIR='.' 60 | while getopts "c:p:h" OPT 61 | do 62 | case $OPT in 63 | "c" ) COLOR="$OPTARG" 64 | ;; 65 | "p" ) PROJECT_DIR="${OPTARG%/}" 66 | check_dir $PROJECT_DIR 67 | ;; 68 | "h" ) usage 69 | ;; 70 | \? ) usage 71 | ;; 72 | esac 73 | done 74 | 75 | 76 | if [ $PROJECT_DIR = '.' ]; then 77 | DRAWABLE_DIR=${PROJECT_DIR}/${DRAWABLE} 78 | if [ ! -e $DRAWABLE_DIR ]; then 79 | echo "Error: specify project" 1>&2 80 | usage 81 | exit 1 82 | fi 83 | else 84 | DRAWABLE_DIR=${PROJECT_DIR}/${DRAWABLE} 85 | fi 86 | 87 | shift $((OPTIND - 1)) 88 | ICON=$1 89 | 90 | $CURL -s $SRC > $MATERIALS_HTML 91 | cat $MATERIALS_HTML | $PERL -nle 'if($_=~/^

(.*)<\/div>$/){print "$1"}' > $ICON_LIST 92 | 93 | ICON_SVG="ic_${ICON}_24px.svg" 94 | 95 | EXIST_FLG=`cat $ICON_LIST | $GREP $ICON_SVG | wc -l` 96 | 97 | if [ $EXIST_FLG -ne 1 ]; then 98 | echo "wrong icon name" 99 | exit 1 100 | fi 101 | 102 | ICON_PATH=`cat $ICON_LIST | $GREP $ICON_SVG` 103 | ICON_URL=$SRC$ICON_PATH 104 | 105 | echo "Downloading $ICON svg ..." 106 | if ! $CURL -s -o /tmp/$ICON_SVG -O $ICON_URL; then 107 | echo "Error: wrong paramter $ICON" 1>&2 108 | exit 1 109 | fi 110 | 111 | $SED -i -e "s/\(path d=.*\)\(\/>$\)/\1 fill=\"$COLOR\"\2/" /tmp/$ICON_SVG 112 | $SED -i -e "s/\(fill=\"none\"\) \(fill=\"$COLOR\"\)/\1/" /tmp/$ICON_SVG 113 | 114 | echo "Converting svg to png ..." 115 | $INKSCAPE -z -e ic_${ICON}_24px.png -w 24 -h 24 /tmp/$ICON_SVG >> /dev/null 116 | $INKSCAPE -z -e ic_${ICON}_36px.png -w 36 -h 36 /tmp/$ICON_SVG >> /dev/null 117 | $INKSCAPE -z -e ic_${ICON}_48px.png -w 48 -h 48 /tmp/$ICON_SVG >> /dev/null 118 | $INKSCAPE -z -e ic_${ICON}_72px.png -w 72 -h 72 /tmp/$ICON_SVG >> /dev/null 119 | $INKSCAPE -z -e ic_${ICON}_96px.png -w 96 -h 96 /tmp/$ICON_SVG >> /dev/null 120 | 121 | 122 | if [ -d ${DRAWABLE_DIR}-mdpi ]; then 123 | $MV ic_${ICON}_24px.png ${DRAWABLE_DIR}-mdpi/ic_${ICON}.png 124 | fi 125 | if [ -d ${DRAWABLE_DIR}-hdpi ]; then 126 | $MV ic_${ICON}_36px.png ${DRAWABLE_DIR}-hdpi/ic_${ICON}.png 127 | fi 128 | if [ -d ${DRAWABLE_DIR}-xhdpi ]; then 129 | $MV ic_${ICON}_48px.png ${DRAWABLE_DIR}-xhdpi/ic_${ICON}.png 130 | fi 131 | if [ -d ${DRAWABLE_DIR}-xxhdpi ]; then 132 | $MV ic_${ICON}_72px.png ${DRAWABLE_DIR}-xxhdpi/ic_${ICON}.png 133 | fi 134 | if [ -d ${DRAWABLE_DIR}-xxxhdpi ]; then 135 | $MV ic_${ICON}_96px.png ${DRAWABLE_DIR}-xxxhdpi/ic_${ICON}.png 136 | else 137 | $RM ic_${ICON}_96px.png 138 | fi 139 | 140 | echo "success!" 141 | -------------------------------------------------------------------------------- /icon_list.txt: -------------------------------------------------------------------------------- 1 | 3d_rotation 2 | accessibility 3 | account_balance 4 | account_balance_wallet 5 | account_box 6 | account_child 7 | account_circle 8 | add_shopping_cart 9 | alarm 10 | alarm_add 11 | alarm_off 12 | alarm_on 13 | android 14 | announcement 15 | aspect_ratio 16 | assessment 17 | assignment 18 | assignment_ind 19 | assignment_late 20 | assignment_return 21 | assignment_returned 22 | assignment_turned_in 23 | autorenew 24 | backup 25 | book 26 | bookmark 27 | bookmark_outline 28 | bug_report 29 | cached 30 | class 31 | credit_card 32 | dashboard 33 | delete 34 | description 35 | dns 36 | done 37 | done_all 38 | event 39 | exit_to_app 40 | explore 41 | extension 42 | face_unlock 43 | favorite 44 | favorite_outline 45 | find_in_page 46 | find_replace 47 | flip_to_back 48 | flip_to_front 49 | get_app 50 | grade 51 | group_work 52 | help 53 | highlight_remove 54 | history 55 | home 56 | https 57 | info 58 | info_outline 59 | input 60 | invert_colors 61 | label 62 | label_outline 63 | language 64 | launch 65 | list 66 | lock 67 | lock_open 68 | lock_outline 69 | loyalty 70 | markunread_mailbox 71 | note_add 72 | open_in_browser 73 | open_in_new 74 | open_with 75 | pageview 76 | payment 77 | perm_camera_mic 78 | perm_contact_cal 79 | perm_data_setting 80 | perm_device_info 81 | perm_identity 82 | perm_media 83 | perm_phone_msg 84 | perm_scan_wifi 85 | picture_in_picture 86 | polymer 87 | print 88 | query_builder 89 | question_answer 90 | receipt 91 | redeem 92 | reorder 93 | report_problem 94 | restore 95 | room 96 | schedule 97 | search 98 | settings 99 | settings_applications 100 | settings_backup_restore 101 | settings_bluetooth 102 | settings_cell 103 | settings_display 104 | settings_ethernet 105 | settings_input_antenna 106 | settings_input_component 107 | settings_input_composite 108 | settings_input_hdmi 109 | settings_input_svideo 110 | settings_overscan 111 | settings_phone 112 | settings_power 113 | settings_remote 114 | settings_voice 115 | shop 116 | shop_two 117 | shopping_basket 118 | shopping_cart 119 | speaker_notes 120 | spellcheck 121 | star_rate 122 | stars 123 | store 124 | subject 125 | supervisor_account 126 | swap_horiz 127 | swap_vert 128 | swap_vert_circle 129 | system_update_tv 130 | tab 131 | tab_unselected 132 | theaters 133 | thumb_down 134 | thumb_up 135 | thumbs_up_down 136 | toc 137 | today 138 | track_changes 139 | translate 140 | trending_down 141 | trending_neutral 142 | trending_up 143 | turned_in 144 | turned_in_not 145 | verified_user 146 | view_agenda 147 | view_array 148 | view_carousel 149 | view_column 150 | view_day 151 | view_headline 152 | view_list 153 | view_module 154 | view_quilt 155 | view_stream 156 | view_week 157 | visibility 158 | visibility_off 159 | wallet_giftcard 160 | wallet_membership 161 | wallet_travel 162 | work 163 | error 164 | warning 165 | album 166 | av_timer 167 | closed_caption 168 | equalizer 169 | explicit 170 | fast_forward 171 | fast_rewind 172 | games 173 | hearing 174 | high_quality 175 | loop 176 | mic 177 | mic_none 178 | mic_off 179 | movie 180 | my_library_add 181 | my_library_books 182 | my_library_music 183 | new_releases 184 | not_interested 185 | pause 186 | pause_circle_fill 187 | pause_circle_outline 188 | play_arrow 189 | play_circle_fill 190 | play_circle_outline 191 | play_shopping_bag 192 | playlist_add 193 | queue 194 | queue_music 195 | radio 196 | recent_actors 197 | repeat 198 | repeat_one 199 | replay 200 | shuffle 201 | skip_next 202 | skip_previous 203 | snooze 204 | stop 205 | subtitles 206 | surround_sound 207 | video_collection 208 | videocam 209 | videocam_off 210 | volume_down 211 | volume_mute 212 | volume_off 213 | volume_up 214 | web 215 | business 216 | call 217 | call_end 218 | call_made 219 | call_merge 220 | call_missed 221 | call_received 222 | call_split 223 | chat 224 | clear_all 225 | comment 226 | contacts 227 | dialer_sip 228 | dialpad 229 | dnd_on 230 | email 231 | forum 232 | import_export 233 | invert_colors_off 234 | invert_colors_on 235 | live_help 236 | location_off 237 | location_on 238 | message 239 | messenger 240 | no_sim 241 | phone 242 | portable_wifi_off 243 | quick_contacts_dialer 244 | quick_contacts_mail 245 | ring_volume 246 | stay_current_landscape 247 | stay_current_portrait 248 | stay_primary_landscape 249 | stay_primary_portrait 250 | swap_calls 251 | textsms 252 | voicemail 253 | vpn_key 254 | add 255 | add_box 256 | add_circle 257 | add_circle_outline 258 | archive 259 | backspace 260 | block 261 | clear 262 | content_copy 263 | content_cut 264 | content_paste 265 | create 266 | drafts 267 | filter_list 268 | flag 269 | forward 270 | gesture 271 | inbox 272 | link 273 | mail 274 | markunread 275 | redo 276 | remove 277 | remove_circle 278 | remove_circle_outline 279 | reply 280 | reply_all 281 | report 282 | save 283 | select_all 284 | send 285 | sort 286 | text_format 287 | undo 288 | access_alarm 289 | access_alarms 290 | access_time 291 | add_alarm 292 | airplanemode_off 293 | airplanemode_on 294 | battery_20 295 | battery_30 296 | battery_50 297 | battery_60 298 | battery_80 299 | battery_90 300 | battery_alert 301 | battery_charging_20 302 | battery_charging_30 303 | battery_charging_50 304 | battery_charging_60 305 | battery_charging_80 306 | battery_charging_90 307 | battery_charging_full 308 | battery_full 309 | battery_std 310 | battery_unknown 311 | bluetooth 312 | bluetooth_connected 313 | bluetooth_disabled 314 | bluetooth_searching 315 | brightness_auto 316 | brightness_high 317 | brightness_low 318 | brightness_medium 319 | data_usage 320 | developer_mode 321 | devices 322 | dvr 323 | gps_fixed 324 | gps_not_fixed 325 | gps_off 326 | location_disabled 327 | location_searching 328 | multitrack_audio 329 | network_cell 330 | network_wifi 331 | nfc 332 | now_wallpaper 333 | now_widgets 334 | screen_lock_landscape 335 | screen_lock_portrait 336 | screen_lock_rotation 337 | screen_rotation 338 | sd_storage 339 | settings_system_daydream 340 | signal_cellular_0_bar 341 | signal_cellular_1_bar 342 | signal_cellular_2_bar 343 | signal_cellular_3_bar 344 | signal_cellular_4_bar 345 | signal_cellular_connected_no_internet_0_bar 346 | signal_cellular_connected_no_internet_1_bar 347 | signal_cellular_connected_no_internet_2_bar 348 | signal_cellular_connected_no_internet_3_bar 349 | signal_cellular_connected_no_internet_4_bar 350 | signal_cellular_no_sim 351 | signal_cellular_null 352 | signal_cellular_off 353 | signal_wifi_0_bar 354 | signal_wifi_1_bar 355 | signal_wifi_2_bar 356 | signal_wifi_3_bar 357 | signal_wifi_4_bar 358 | signal_wifi_off 359 | storage 360 | usb 361 | wifi_lock 362 | wifi_tethering 363 | attach_file 364 | attach_money 365 | border_all 366 | border_bottom 367 | border_clear 368 | border_color 369 | border_horizontal 370 | border_inner 371 | border_left 372 | border_outer 373 | border_right 374 | border_style 375 | border_top 376 | border_vertical 377 | format_align_center 378 | format_align_justify 379 | format_align_left 380 | format_align_right 381 | format_bold 382 | format_clear 383 | format_color_fill 384 | format_color_reset 385 | format_color_text 386 | format_indent_decrease 387 | format_indent_increase 388 | format_italic 389 | format_line_spacing 390 | format_list_bulleted 391 | format_list_numbered 392 | format_paint 393 | format_quote 394 | format_size 395 | format_strikethrough 396 | format_textdirection_l_to_r 397 | format_textdirection_r_to_l 398 | format_underline 399 | functions 400 | insert_chart 401 | insert_comment 402 | insert_drive_file 403 | insert_emoticon 404 | insert_invitation 405 | insert_link 406 | insert_photo 407 | merge_type 408 | mode_comment 409 | mode_edit 410 | publish 411 | vertical_align_bottom 412 | vertical_align_center 413 | vertical_align_top 414 | wrap_text 415 | attachment 416 | cloud 417 | cloud_circle 418 | cloud_done 419 | cloud_download 420 | cloud_off 421 | cloud_queue 422 | cloud_upload 423 | file_download 424 | file_upload 425 | folder 426 | folder_open 427 | folder_shared 428 | cast 429 | cast_connected 430 | computer 431 | desktop_mac 432 | desktop_windows 433 | dock 434 | gamepad 435 | headset 436 | headset_mic 437 | keyboard 438 | keyboard_alt 439 | keyboard_arrow_down 440 | keyboard_arrow_left 441 | keyboard_arrow_right 442 | keyboard_arrow_up 443 | keyboard_backspace 444 | keyboard_capslock 445 | keyboard_control 446 | keyboard_hide 447 | keyboard_return 448 | keyboard_tab 449 | keyboard_voice 450 | laptop 451 | laptop_chromebook 452 | laptop_mac 453 | laptop_windows 454 | memory 455 | mouse 456 | phone_android 457 | phone_iphone 458 | phonelink 459 | phonelink_off 460 | security 461 | sim_card 462 | smartphone 463 | speaker 464 | tablet 465 | tablet_android 466 | tablet_mac 467 | tv 468 | watch 469 | add_to_photos 470 | adjust 471 | assistant_photo 472 | audiotrack 473 | blur_circular 474 | blur_linear 475 | blur_off 476 | blur_on 477 | brightness_1 478 | brightness_2 479 | brightness_3 480 | brightness_4 481 | brightness_5 482 | brightness_6 483 | brightness_7 484 | brush 485 | camera 486 | camera_alt 487 | camera_front 488 | camera_rear 489 | camera_roll 490 | center_focus_strong 491 | center_focus_weak 492 | collections 493 | color_lens 494 | colorize 495 | compare 496 | control_point 497 | control_point_duplicate 498 | crop_16_9 499 | crop 500 | crop_3_2 501 | crop_5_4 502 | crop_7_5 503 | crop_din 504 | crop_free 505 | crop_landscape 506 | crop_original 507 | crop_portrait 508 | crop_square 509 | dehaze 510 | details 511 | edit 512 | exposure 513 | exposure_minus_1 514 | exposure_minus_2 515 | exposure_plus_1 516 | exposure_plus_2 517 | exposure_zero 518 | filter_1 519 | filter 520 | filter_2 521 | filter_3 522 | filter_4 523 | filter_5 524 | filter_6 525 | filter_7 526 | filter_8 527 | filter_9 528 | filter_9_plus 529 | filter_b_and_w 530 | filter_center_focus 531 | filter_drama 532 | filter_frames 533 | filter_hdr 534 | filter_none 535 | filter_tilt_shift 536 | filter_vintage 537 | flare 538 | flash_auto 539 | flash_off 540 | flash_on 541 | flip 542 | gradient 543 | grain 544 | grid_off 545 | grid_on 546 | hdr_off 547 | hdr_on 548 | hdr_strong 549 | hdr_weak 550 | healing 551 | image 552 | image_aspect_ratio 553 | iso 554 | landscape 555 | leak_add 556 | leak_remove 557 | lens 558 | looks 559 | looks_3 560 | looks_4 561 | looks_5 562 | looks_6 563 | looks_one 564 | looks_two 565 | loupe 566 | movie_creation 567 | nature 568 | nature_people 569 | navigate_before 570 | navigate_next 571 | palette 572 | panorama 573 | panorama_fisheye 574 | panorama_horizontal 575 | panorama_vertical 576 | panorama_wide_angle 577 | photo 578 | photo_album 579 | photo_camera 580 | photo_library 581 | portrait 582 | remove_red_eye 583 | rotate_left 584 | rotate_right 585 | slideshow 586 | straighten 587 | style 588 | switch_camera 589 | switch_video 590 | tag_faces 591 | texture 592 | timelapse 593 | timer_10 594 | timer 595 | timer_3 596 | timer_auto 597 | timer_off 598 | tonality 599 | transform 600 | tune 601 | wb_auto 602 | wb_cloudy 603 | wb_incandescent 604 | wb_irradescent 605 | wb_sunny 606 | beenhere 607 | directions 608 | directions_bike 609 | directions_bus 610 | directions_car 611 | directions_ferry 612 | directions_subway 613 | directions_train 614 | directions_transit 615 | directions_walk 616 | flight 617 | hotel 618 | layers 619 | layers_clear 620 | local_airport 621 | local_atm 622 | local_attraction 623 | local_bar 624 | local_cafe 625 | local_car_wash 626 | local_convenience_store 627 | local_drink 628 | local_florist 629 | local_gas_station 630 | local_grocery_store 631 | local_hospital 632 | local_hotel 633 | local_laundry_service 634 | local_library 635 | local_mall 636 | local_movies 637 | local_offer 638 | local_parking 639 | local_pharmacy 640 | local_phone 641 | local_pizza 642 | local_play 643 | local_post_office 644 | local_print_shop 645 | local_restaurant 646 | local_see 647 | local_shipping 648 | local_taxi 649 | location_history 650 | map 651 | my_location 652 | navigation 653 | pin_drop 654 | place 655 | rate_review 656 | restaurant_menu 657 | satellite 658 | store_mall_directory 659 | terrain 660 | traffic 661 | apps 662 | arrow_back 663 | arrow_drop_down 664 | arrow_drop_down_circle 665 | arrow_drop_up 666 | arrow_forward 667 | cancel 668 | check 669 | chevron_left 670 | chevron_right 671 | close 672 | expand_less 673 | expand_more 674 | fullscreen 675 | fullscreen_exit 676 | menu 677 | more_horiz 678 | more_vert 679 | refresh 680 | unfold_less 681 | unfold_more 682 | adb 683 | bluetooth_audio 684 | disc_full 685 | dnd_forwardslash 686 | do_not_disturb 687 | drive_eta 688 | event_available 689 | event_busy 690 | event_note 691 | folder_special 692 | mms 693 | more 694 | network_locked 695 | phone_bluetooth_speaker 696 | phone_forwarded 697 | phone_in_talk 698 | phone_locked 699 | phone_missed 700 | phone_paused 701 | play_download 702 | play_install 703 | sd_card 704 | sim_card_alert 705 | sms 706 | sms_failed 707 | sync 708 | sync_disabled 709 | sync_problem 710 | system_update 711 | tap_and_play 712 | time_to_leave 713 | vibration 714 | voice_chat 715 | vpn_lock 716 | cake 717 | domain 718 | group 719 | group_add 720 | location_city 721 | mood 722 | notifications 723 | notifications_none 724 | notifications_off 725 | notifications_on 726 | notifications_paused 727 | pages 728 | party_mode 729 | people 730 | people_outline 731 | person 732 | person_add 733 | person_outline 734 | plus_one 735 | poll 736 | public 737 | school 738 | share 739 | whatshot 740 | check_box 741 | check_box_outline_blank 742 | radio_button_off 743 | radio_button_on 744 | star 745 | star_half 746 | star_outline 747 | --------------------------------------------------------------------------------