Android Res Export

Export Android resources in Sketch – PNG assets, app icon, nine-patch image, shape XML, color resource xml and vector drawable.

v2.3.18 is compatible with Sketch 4.0.0

Android Res Export

中文说明

Export Android resources in Sketch – PNG assets, app icon, nine-patch image, shape XML, color resource xml and vector drawable.

Features

  • Export PNG assets into multiple sizes.
  • Preview and export nine-patch assets into multiple sizes.
  • Export app launcher icon for Android 8 and older version.
  • View and export shape drawable XML code.
  • Export vector drawable asset.
  • Compress PNGs after export use ImageOptim.
  • View and export color resource XML code from Sketch document colors or selected layers.

Installation

Install plugin

  • Search "Android Res Export" from [Sketch Runner or Sketchpacks.
  • Download master.zip and unzip, then double-click "Android_Res_Export.sketchplugin" to install.

Nine-patch support configure

Install Command Line Tools.

xcode-select --install

Install Homebrew.

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

After hombrew installed, use this command to install ImageMagick.

brew install imagemagick

Vector drawable support configure

Install Node.js. Then use this command to install SVGO and svg2vectordrawable.

npm install -g svgo svg2vectordrawable

How it Works

Design at MDPI (1x) size, NOT support for other sizes. Download demo.sketch

Use menu "Plugins" - "Android Res Export" - "New PNG Asset" to create PNG assets.

Use menu "Plugin" - "Android Res Export" - "New Nine-Patch Asset" to create a nine-patch asset. Run "Nine-Patch Preview " for preview the nine-patch assset.

Use menu "Plugin" - "Android Res Export" - "New Vector Drawable Asset" to create a vector drawable asset.

If you want to support Android API < 24 (7.0), select the shape layers in vector drawable group, click the settings icon in fill property panel, and choose "Non-Zero".

Before export the assets, you must create them use "New ... Asset" in plugin menu. Selected the spical asset layer group, then run "Export ... Assets" to export them, and deselected all to export all assets.

For app icons, you need to selected the template page, before run the "Export App Icon".

License

Apache 2.0

Donate

Donate$2.00, $5.00 $10.00 via PayPal.


Join the discussion

Download v2.3.18
Usage Activity
400100

Avg. user activity in the last 30 days

Stats
  • 343 downloads all–time
  • 6 downloads this week
  • 15 downloads this month
About this plugin

Ashung published this plugin 2y ago.

v2.3.18 is the latest version.

Native updates are supported within Sketch.app.