[Android General] SXUsr:
Vector Drawable

New section added...

Vector Drawable:

A VectorDrawable is a vector graphic defined in an XML file as a set of points, lines, and curves along with its associated color information. The major advantage of using a vector drawable is image scalability. It can be scaled without loss of display quality, which means the same file is resized for different screen densities without loss of image quality. This results in smaller APK files and less developer maintenance. You can also use vector images for animation by using multiple XML files instead of multiple images for each display resolution.​

- developer.android.com/guide/topics/graphics/vector-drawable-resources

Vector drawables obviously serve a purpose but are a pita imo for themers as they are a lot more difficult to edit and achieve the look you want.

Using my power menu to illustrate the problem, Power off, Restart and Take screenshot icons are vector drawables but the Record screen icon is a png...

​

...as you can see the Record screen icon is significantly bigger and ruins the look of my power menu, to over come this I have two options.

1. Learn how to edit vector drawables and create a new icon.

2. Replace the vector drawables and use pngs.

The latter to me is preferable because I already have images that I've been using for the last few years and want to continue using, to do so I need to replace the code in the relevant xmls to point at images...

framework-res/drawable/ic_lock_power_off.xml

Vector drawable code...

<?xml version="1.0" encoding="utf-8"?>
<vector android:tint="?colorControlNormal" android:height="24.0dip" android:width="24.0dip" android:viewportWidth="24.0" android:viewportHeight="24.0"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#ff000000" android:pathData="M13.0,3.0l-2.0,0.0l0.0,10.0l2.0,0.0L13.0,3.0zm4.83,2.17l-1.42,1.42C17.99,7.86 19.0,9.81 19.0,12.0c0.0,3.87 -3.13,7.0 -7.0,7.0s-7.0,-3.13 -7.0,-7.0c0.0,-2.19 1.01,-4.14 2.58,-5.42L6.17,5.17C4.23,6.82 3.0,9.26 3.0,12.0c0.0,4.97 4.03,9.0 9.0,9.0s9.0,-4.03 9.0,-9.0c0.0,-2.74 -1.23,-5.18 -3.17,-6.83z" />
</vector>

My edited code...

<?xml version="1.0" encoding="utf-8"?>
<bitmap android:src="@drawable/ic_lock_power_off_alpha"
xmlns:android="http://schemas.android.com/apk/res/android" />

framework-res/drawable/ic_restart.xml

Vector drawable code...

<?xml version="1.0" encoding="utf-8"?>
<vector android:tint="?colorControlNormal" android:height="24.0dip" android:width="24.0dip" android:viewportWidth="24.0" android:viewportHeight="24.0"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#ff000000" android:pathData="M12.0,4.0L12.0,1.0L8.0,5.0l4.0,4.0L12.0,6.0c3.9,0.0 7.0,3.1 7.0,7.0c0.0,3.9 -3.1,7.0 -7.0,7.0l0.0,2.0c5.0,0.0 9.0,-4.0 9.0,-9.0C21.0,8.0 17.0,4.0 12.0,4.0z" />
<path android:fillColor="#ff000000" android:pathData="M5.0,12.9C5.0,11.0 5.8,9.2 7.2,7.9L5.8,6.4C4.0,8.1 3.0,10.5 3.0,12.9c0.0,4.0 2.7,7.6 6.5,8.7l0.5,-1.9C7.1,18.8 5.0,16.1 5.0,12.9z" />
</vector>

My edited code...

<?xml version="1.0" encoding="utf-8"?>
<bitmap android:src="@drawable/ic_lock_restart"
xmlns:android="http://schemas.android.com/apk/res/android" />

framework-res/drawable/ic_semc_ic_dialog_screenshot.xml

Vector drawable code...

<?xml version="1.0" encoding="utf-8"?>
<vector android:height="24.0dip" android:width="24.0dip" android:viewportWidth="24.0" android:viewportHeight="24.0"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#8a000000" android:pathData="M5,5l4,0l0,-2l-4,0l-2,0l0,2l0,4l2,0l0,-4z" />
<path android:fillColor="#8a000000" android:pathData="M19,3l-4,0l0,2l4,0l0,4l2,0l0,-4l0,-2l-2,0z" />
<path android:fillColor="#8a000000" android:pathData="M5,15l-2,0l0,4l0,2l2,0l4,0l0,-2l-4,0l0,-4z" />
<path android:fillColor="#8a000000" android:pathData="M19,19l-4,0l0,2l4,0l2,0l0,-2l0,-4l-2,0l0,4z" />
<path android:fillColor="#8a000000" android:pathData="M16,13l0,-2l-3,0l0,-3l-2,0l0,3l-3,0l0,2l3,0l0,3l2,0l0,-3l3,0z" />
</vector>

My edited code...

<?xml version="1.0" encoding="utf-8"?>
<bitmap android:src="@drawable/semc_ic_dialog_screenshot"
xmlns:android="http://schemas.android.com/apk/res/android" />

...and the result as you can see here provides a much more unified look...

​

...and finally my desired end result...

​