At some point in an Android project you will need to import some drawables - be it toolbar icons, images, UI features - in res/drawable directory. Most of the t
If you download your icons from https://material.io/icons/, you can use the following Bash function to import a bunch of icons in one go:
import_icons() {
project_dir=${1%/}
shift 1
for zip in "$@"; do
unzipped_dir=${zip%.*}
echo $(basename "$unzipped_dir")
unzip "$zip" -d $(dirname "$zip") >/dev/null
cp -R "$unzipped_dir"/android/* "$project_dir/app/src/main/res"
done
}
Usage example:
$ import_icons ~/Projects/MyProject ic_1.zip ic_2.zip ic_3.zip
cp -R copies the various source mdpi, hdpi, etc. directories and merges them for you with the existing ones. If the directory structure of your icon package is different, just modify the first argument to cp.