Simple script to organize automatically assets for different screen densities
project/
app/
src/main/res
assets/
png/
svg/
create_png.sh
1. Assets from designer
The designer exports png assets from sketch in 4 sizes:
- x1 (drawable-mdpi)
- x1,5 (drawable-hdpi)
- x2 (drawable-xhdpi)
- x3 (drawable-xxhdpi)
- x4 (drawable-xxxhdpi)
The assets will be in a unique folder with flat hierarchy. The png files are named in the following format:
[email protected]
my_image_1@1,5x.png
[email protected]
[email protected]
[email protected]
[email protected]
my_image_2@1,5x.png
[email protected]
[email protected]
[email protected]
etc
2. Convert to android drawable-xxx structure
- Move these assets to
assets/png/
. - Run
create_png.sh
- Done