-
-
Save MrThiago/319edd773417a342a0d3ec82cacedde6 to your computer and use it in GitHub Desktop.
Convert iPhone-resources to Android (for Titanium)
This file contains hidden or 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
type mogrify >/dev/null 2>&1 || { echo >&2 "» This script requires mogrify. Please install ImageMagick first!"; exit 1; } | |
rm -rf Resources/android/images | |
mkdir Resources/android/images | |
mkdir Resources/android/images/res-xhdpi | |
mkdir Resources/android/images/res-mdpi | |
echo " » Copying the splash screen" | |
cp Resources/iphone/Default.png Resources/android/images/res-mdpi/default.png | |
cp Resources/iphone/[email protected] Resources/android/images/res-xhdpi/default.png | |
cd Resources/iphone/images | |
echo " » Copying the folder structure so bash won't complain" | |
find ./* -type d -exec mkdir ../../../Resources/android/images/res-mdpi/{} \; | |
find ./* -type d -exec mkdir ../../../Resources/android/images/res-xhdpi/{} \; | |
echo " » Copy all resources to MDPI, this is" | |
echo " the same density as a non-retina iOS device" | |
find ./* -type f -exec cp {} ../../../Resources/android/images/res-mdpi/{} \; | |
cd ../../../Resources/android/images/res-mdpi/ | |
echo " » Move the retina resources to XHDPI, which" | |
echo " has the same density as a retina iOS device" | |
find ./* -type f -regex ".*@2x.*" -exec mv {} ../res-xhdpi/{} \; | |
cd ../res-xhdpi | |
echo " » Remove @2x from XHDPI filenames" | |
find ./* -type f -exec bash -c 'file={}; mv $file ${file/@2x/}' \; | |
cd ../ | |
echo " » Generate HDPI by copying XHDPI and resize these by 75%" | |
mkdir res-hdpi | |
cp -R res-xhdpi/* res-hdpi | |
cd res-hdpi | |
find ./* -type f -exec mogrify -resize 75% {} \; | |
echo " » Done!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment