Copy Android drawable assets from one directory to another using the standard drawables-hdpi
, drawables-xhdpi
etc
It can be a pain to copy new assets into your Android project when they are provided in the correct dpi directory structure.
Inside the source res directory, you should have child directorys of drawables-hdpi
, drawables-xhdpi
etc which each contain the asset needed to copy. The destination directory should also be the res directory containing each drawables directory.
Example:
./cp-drawables.sh img_to_copy.png /path/to/res/dir
Will execute (and print out):
cp drawable-mdpi/img_to_copy.png /path/to/res/dir/drawable-mdpi/img_to_copy.png
cp drawable-hdpi/img_to_copy.png /path/to/res/dir/drawable-hdpi/img_to_copy.png
cp drawable-xhdpi/img_to_copy.png /path/to/res/dir/drawable-xhdpi/img_to_copy.png
cp drawable-xxhdpi/img_to_copy.png /path/to/res/dir/drawable-xxhdpi/img_to_copy.png
cp drawable-xxxhdpi/img_to_copy.png /path/to/res/dir/drawable-xxxhdpi/img_to_copy.png