make-9patched-splash-ionic
This is a node module that do resize & 9-patch ionic project's splash.png automatically like this.
Dependencies
junkoro/four-sides-1px-9patcher - https://github.com/junkoro/four-sides-1px-9patcher
and this depends on node-canvas.
Automattic/node-canvas - https://github.com/Automattic/node-canvas
Installing node-canvas is bit difficult. Here is how to on mac.
$ brew install pkg-config$ brew install pixman$ brew install cairo$ export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig
Installation
$ npm install make-9patched-splash-ionic$ cp node_modules/make-9patched-splash-ionic/make-9patched-splash-ionic.js .
Usage
$ node make-9patched-splash-ionic.js
!!!! DANGER !!!!
This script will delete all PNG files under resources/android/splash, so watch out!
and we need to edit the config.xml like this.(add '.9' extension for each PNG)
UPDATE 2015.05.06: Now the script edit config.xml automatically. So no more needs to do this!
UPDATE 2015.05.14: Duplicate .9 problem fixed.
・・・・・・
"processDebugResources" issue
If you use "ionic resources" after using make-9patched, you may get "processDebugResources" error when building.
This is because "ionic resources" create un-9patched resources under the following folder.
platforms/android/build/intermediates/res/debug
If you got this error, just delete the folder and rebuild.
The version 0.0.6 will do this, so just re-run make-9patched.
License
WTFPL - http://www.wtfpl.net/