Last active
May 19, 2016 11:20
-
-
Save rasagy/6d30a165b6bb6336259c to your computer and use it in GitHub Desktop.
Revisions
-
rasagy renamed this gist
May 19, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
rasagy revised this gist
May 19, 2016 . 1 changed file with 10 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,16 @@ # Quick hack for exporting assets for android, expanded on the tip in this article: https://medium.com/@lmindler/using-sketch-3-and-a-bit-of-fairy-dust-for-a-better-android-workflow-f667d0048855#.ssmzsmkko and the script here: http://f.cl.ly/items/3E3Q0N2M3m2Q1q322L0j/android_asset_organizer.txt # Use Sketch Export to export each asset in one folder with suffix as: -mdpi (1x), -hdpi (1.5x), -xhdpi (2x), -xxhdpi (3x), -xxxhdpi (4x) # Then, open terminal in that folder and run this command. # Find all exported assets in a separate ../res/ folder. # My directory structure is as follows: # /Assets/ # /Exported from Slack/ # /res/ # /iOS/ # Terminal command should be run in /Exported from Slack/ so it moves the assets to ../res/ folder. I tend to move the rest to iOS (not automated in this script). # Feel free to remove ../ in case you want the res folder _inside_ your assets folder. mkdir ../res; mkdir ../res/drawable-xxxhdpi; mkdir ../res/drawable-xxhdpi; mkdir ../res/drawable-xhdpi; mkdir ../res/drawable-hdpi; mkdir ../res/drawable-mdpi -
rasagy revised this gist
May 19, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,8 +3,8 @@ # Find all exported assets in a separate ../res/ folder. # Feel free to remove ../ in case you want the res folder _inside_ your assets folder. mkdir ../res; mkdir ../res/drawable-xxxhdpi; mkdir ../res/drawable-xxhdpi; mkdir ../res/drawable-xhdpi; mkdir ../res/drawable-hdpi; mkdir ../res/drawable-mdpi for file in $(find . -type f -iname '*-xxxhdpi*'); do mv "$file" "../res/drawable-xxxhdpi/${file/-xxxhdpi/}" done -
rasagy created this gist
Feb 23, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ # Use Sketch Export to export each asset in one folder with suffix as: -mdpi (1x), -hdpi (1.5x), -xhdpi (2x), -xxhdpi (3x), -xxxhdpi (4x) # Then, open terminal in that folder and run this command. # Find all exported assets in a separate ../res/ folder. # Feel free to remove ../ in case you want the res folder _inside_ your assets folder. mkdir ../res/drawable-xxhdpi; mkdir ../res/drawable-xhdpi; ../res/mkdir drawable-hdpi; ../res/mkdir drawable-mdpi done for file in $(find . -type f -iname '*-xxxhdpi*'); do mv "$file" "../res/drawable-xxxhdpi/${file/-xxxhdpi/}" done for file in $(find . -type f -iname '*-xxhdpi*'); do mv "$file" "../res/drawable-xxhdpi/${file/-xxhdpi/}" done for file in $(find . -type f -iname '*-xhdpi*'); do mv "$file" "../res/drawable-xhdpi/${file/-xhdpi/}" done for file in $(find . -type f -iname '*-hdpi*'); do mv "$file" "../res/drawable-hdpi/${file/-hdpi/}" done for file in $(find . -type f -iname '*-mdpi*'); do mv "$file" "../res/drawable-mdpi/${file/-mdpi/}" done