Hi,
today i want to show you, how can we create vector drawables using Photoshop and Vector Asset Studio.as you know Using vector drawables can produce a smaller APK, but the initial loading of vector drawables can take longer.
before starting this article we shod to notice some notes:
open Photoshop and create a new document with width and height max to 200px
select Pen tool
from toolbar and draw some shapes in your document, as you need, you can draw custom shapes using Custom Shape Tool
today i want to show you, how can we create vector drawables using Photoshop and Vector Asset Studio.as you know Using vector drawables can produce a smaller APK, but the initial loading of vector drawables can take longer.
before starting this article we shod to notice some notes:
- The initial loading of a vector drawable can cost more CPU cycles than the corresponding raster image. Afterward, memory use and performance are similar between the two. We recommend that you limit a vector image to a maximum of 200 x 200 dp; otherwise, it can take too long to draw
- Although vector drawables do support one or more colors, in many cases it makes sense to color icons black (android:fillColor="#FF000000"). Using this approach, you can add a tint to the vector drawable that you placed in a layout, and the icon color changes to the tint color. If the icon color isn't black, the icon color might instead blend with the tint color.
now, lets start.
select Pen tool
you can draw any shape, any layer is a Path element in your SVG xml file, so you can define multiple layers in Photoshop for different shapes, fill each shape with a custom color and finally save your work as a PSD file,
now back to Android Studio, and run Vector Asset Studio using Menu File> New> Vector Asset
in this window choose "Local file(SVG, PSD)" radio button, and browse to your file and press OK.
and Done.
for a practice i designed this picture in Photoshop and you can use it for a better learning using this github link PSD to Vector Drawable .
to seea video refer this link How to create Android Vector Asset from image using Photoshop




Comments
Post a Comment