Skip to content

Instantly share code, notes, and snippets.

@AlmogBaku
Last active December 30, 2015 12:05
Show Gist options
  • Save AlmogBaku/5d0f621a9c5919193cb8 to your computer and use it in GitHub Desktop.
Save AlmogBaku/5d0f621a9c5919193cb8 to your computer and use it in GitHub Desktop.
Order photoshop exported resources for android
  1. Export from XXHDPI export

  2. Define this exports: (size -> suffix)

     - 1x -> @1x
     - 0.66x -> @0,66x
     - 0.5x -> @0,5x
     - 0.33x -> @0,33x
    

exports values

  1. Open command line to the exported directory
  2. Run this script sh order_ps_res.sh
#!/bin/bash
res_organize() {
res_dir=$1
res_suffix=$2
if [ ! -d "./${res_dir}" ]; then
mkdir ./${res_dir}
fi;
echo "Move all \"*${res_suffix}.*\" to ${res_dir}:"
for file in `echo *${res_suffix}*`; do
new_name=`echo $file | tr -d ${res_suffix} | tr -s " " "_"`
echo " >>> \"`echo ${file}`\" -> \"${new_name}\""
mv ${file} ./${res_dir}/${new_name}
done;
}
res_organize drawable-mdpi @0,33x
res_organize drawable-hdpi @0,5x
res_organize drawable-xhdpi @0,66x
res_organize drawable-xxhdpi @1x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment