效果图如下:
目录
一、电池边框矢量图
bird_ic_statusbar_battery.xml
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="@dimen/bird_stat_sys_battery_width"
android:height="@dimen/bird_stat_sys_battery_height"
android:viewportWidth="30"
android:viewportHeight="10">
<path
android:fillType="evenOdd"
android:strokeWidth="1"
android:pathData="M 0 0 H 19 V 10 H 0 V 0 Z" />
<path
android:fillColor="@android:color/white"
android:fillType="nonZero"
android:pathData="M27.1538462,0.333333333 L2,0.333333333 C1.07952542,0.333333333 0.333333333,1.07952542 0.333333333,2 L0.333333333,8 C0.333333333,8.92047458 1.07952542,9.66666667 2,9.66666667 L27.1538462,9.66666667 C28.0743207,9.66666667 28.8205128,8.92047458 28.8205128,8 L28.8205128,2 C28.8205128,1.07952542 28.0743207,0.333333333 27.1538462,0.333333333 Z M27.1538462,1 C27.7061309,1 28.1538462,1.44771525 28.1538462,2 L28.1538462,8 C28.1538462,8.55228475 27.7061309,9 27.1538462,9 L2,9 C1.44771525,9 1,8.55228475 1,8 L1,2 C1,1.44771525 1.44771525,1 2,1 L27.1538462,1 Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
<path
android:fillColor="@android:color/white"
android:fillType="evenOdd"
android:pathData="M 29.3205128 3.33333333 L 29.3205128 3.33333333 Q 29.8205128 3.33333333 29.8205128 3.83333333 L 29.8205128 6.16666666 Q 29.8205128 6.66666666 29.3205128 6.66666666 L 29.3205128 6.66666666 Q 28.8205128 6.66666666 28.8205128 6.16666666 L 28.8205128 3.83333333 Q 28.8205128 3.33333333 29.3205128 3.33333333 Z"
android:strokeWidth="2.66666667"
android:strokeColor="@android:color/white" />
</vector>
二、充电(闪电)图标矢量图
bird_ic_statusbar_battery_charge_icon.xml
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="13dp"
android:height="15dp"
android:viewportWidth="5"
android:viewportHeight="6">
<path
android:pathData="M4.85053,2.59753C4.83827,2.58589 4.82431,2.57618 4.80913,2.56873C4.77942,2.54575 4.74291,2.5333 4.70534,2.53333L3.07558,2.53333L3.62303,0.22411C3.62839,0.20166 3.6287,0.1783 3.62393,0.15571C3.62232,0.11439 3.60467,0.07533 3.57474,0.04681C3.50841,-0.01606 3.40434,-0.01553 3.33866,0.04801L0.14873,3.17416C0.11465,3.20686 0.09694,3.25306 0.10043,3.30017C0.09759,3.34582 0.1139,3.3906 0.14543,3.42373C0.17697,3.45687 0.22088,3.47536 0.26662,3.47477L1.94948,3.47477L1.38882,5.74919C1.38573,5.76185 1.38421,5.77485 1.38433,5.78789C1.36464,5.84629 1.38068,5.91081 1.42542,5.9532C1.45812,5.9844 1.50041,6 1.54271,6C1.58708,6.00022 1.62975,5.98298 1.6615,5.952L4.85173,2.82614C4.88279,2.79615 4.90022,2.75476 4.9,2.71158C4.89977,2.6684 4.8819,2.6272 4.85053,2.59753L4.85053,2.59753Z"
android:strokeWidth="1"
android:fillColor="@android:color/white"
android:fillType="nonZero"
android:strokeColor="#00000000"/>
</vector>
三、电量等级矢量图
bird_stat_sys_battery_level_list.xml
<?xml version="1.0" encoding="utf-8"?>
<level-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/bird_ic_statusbar_battery_5" android:maxLevel="5" />
<item android:drawable="@drawable/bird_ic_statusbar_battery_10" android:maxLevel="10" />
<item android:drawable="@drawable/bird_ic_statusbar_battery_20" android:maxLevel="20" />
<item android:drawable="@drawable/bird_ic_statusbar_battery_30" android:maxLevel="30" />
<item android:drawable="@drawable/bird_ic_statusbar_battery_40" android:maxLevel="40" />
<item android:drawable="@drawable/bird_ic_statusbar_battery_50" android:maxLevel="50" />
<item android:drawable="@drawable/bird_ic_statusbar_battery_60" android:maxLevel="60" />
<item android:drawable="@drawable/bird_ic_statusbar_battery_70" android:maxLevel="70" />
<item android:drawable="@drawable/bird_ic_statusbar_battery_80" android:maxLevel="80" />
<item android:drawable="@drawable/bird_ic_statusbar_battery_90" android:maxLevel="90" />
<item android:drawable="@drawable/bird_ic_statusbar_battery_95" android:maxLevel="95" />
<item android:drawable="@drawable/bird_ic_statusbar_battery_100" android:maxLevel="100" />
</level-list>
bird_ic_statusbar_battery_5.xml
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="@dimen/bird_stat_sys_battery_width"
android:height="@dimen/bird_stat_sys_battery_height"
android:viewportWidth="30"
android:viewportHeight="10">
<path
android:fillColor="@color/bird_battery_warning_color"
android:fillType="evenOdd"
android:pathData="M 2.31557692 1.66666667 L 2.31557692 1.66666667 Q 2.95807692 1.66666667 2.95807692 2.30916667 L 2.95807692 7.69083334 Q 2.95807692 8.33333334 2.31557692 8.33333334 L 2.31557692 8.33333334 Q 1.67307692 8.33333334 1.67307692 7.69083334 L 1.67307692 2.30916667 Q 1.67307692 1.66666667 2.31557692 1.66666667 Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
bird_ic_statusbar_battery_10.xml
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="@dimen/bird_stat_sys_battery_width"
android:height="@dimen/bird_stat_sys_battery_height"
android:viewportWidth="30"
android:viewportHeight="10">
<path
android:fillColor="@color/bird_battery_warning_color"
android:fillType="evenOdd"
android:pathData="M 2.339743607 1.66666667 L 3.576410233 1.66666667 Q 4.24307692 1.66666667 4.24307692 2.333333357 L 4.24307692 7.666666653 Q 4.24307692 8.33333334 3.576410233 8.33333334 L 2.339743607 8.33333334 Q 1.67307692 8.33333334 1.67307692 7.666666653 L 1.67307692 2.333333357 Q 1.67307692 1.66666667 2.339743607 1.66666667 Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
bird_ic_statusbar_battery_20.xml
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="@dimen/bird_stat_sys_battery_width"
android:height="@dimen/bird_stat_sys_battery_height"
android:viewportWidth="30"
android:viewportHeight="10">
<path
android:fillColor="@color/bird_battery_low_color"
android:fillType="evenOdd"
android:pathData="M 2.339743607 1.66666667 L 6.146410233 1.66666667 Q 6.81307692 1.66666667 6.81307692 2.333333357 L 6.81307692 7.666666653 Q 6.81307692 8.33333334 6.146410233 8.33333334 L 2.339743607 8.33333334 Q 1.67307692 8.33333334 1.67307692 7.666666653 L 1.67307692 2.333333357 Q 1.67307692 1.66666667 2.339743607 1.66666667 Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
bird_ic_statusbar_battery_30.xml
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="@dimen/bird_stat_sys_battery_width"
android:height="@dimen/bird_stat_sys_battery_height"
android:viewportWidth="30"
android:viewportHeight="10">
<path
android:fillColor="@color/bird_battry_normal_color"
android:fillType="evenOdd"
android:pathData="M 2.339743607 1.66666667 L 8.716410233 1.66666667 Q 9.38307692 1.66666667 9.38307692 2.333333357 L 9.38307692 7.666666653 Q 9.38307692 8.33333334 8.716410233 8.33333334 L 2.339743607 8.33333334 Q 1.67307692 8.33333334 1.67307692 7.666666653 L 1.67307692 2.333333357 Q 1.67307692 1.66666667 2.339743607 1.66666667 Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
bird_ic_statusbar_battery_40.xml
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="@dimen/bird_stat_sys_battery_width"
android:height="@dimen/bird_stat_sys_battery_height"
android:viewportWidth="30"
android:viewportHeight="10">
<path
android:fillColor="@color/bird_battry_normal_color"
android:fillType="evenOdd"
android:pathData="M 2.339743587 1.66666667 L 11.286410253 1.66666667 Q 11.95307692 1.66666667 11.95307692 2.333333337 L 11.95307692 7.666666673 Q 11.95307692 8.33333334 11.286410253 8.33333334 L 2.339743587 8.33333334 Q 1.67307692 8.33333334 1.67307692 7.666666673 L 1.67307692 2.333333337 Q 1.67307692 1.66666667 2.339743587 1.66666667 Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
bird_ic_statusbar_battery_50.xml
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="@dimen/bird_stat_sys_battery_width"
android:height="@dimen/bird_stat_sys_battery_height"
android:viewportWidth="30"
android:viewportHeight="10">
<path
android:fillColor="@color/bird_battry_normal_color"
android:fillType="evenOdd"
android:pathData="M 2.339743587 1.66666667 L 13.856410253 1.66666667 Q 14.52307692 1.66666667 14.52307692 2.333333337 L 14.52307692 7.666666673 Q 14.52307692 8.33333334 13.856410253 8.33333334 L 2.339743587 8.33333334 Q 1.67307692 8.33333334 1.67307692 7.666666673 L 1.67307692 2.333333337 Q 1.67307692 1.66666667 2.339743587 1.66666667 Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
bird_ic_statusbar_battery_60.xml
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="@dimen/bird_stat_sys_battery_width"
android:height="@dimen/bird_stat_sys_battery_height"
android:viewportWidth="30"
android:viewportHeight="10">
<path
android:fillColor="@color/bird_battry_normal_color"
android:fillType="evenOdd"
android:pathData="M 2.339743587 1.66666667 L 16.426410253 1.66666667 Q 17.09307692 1.66666667 17.09307692 2.333333337 L 17.09307692 7.666666673 Q 17.09307692 8.33333334 16.426410253 8.33333334 L 2.339743587 8.33333334 Q 1.67307692 8.33333334 1.67307692 7.666666673 L 1.67307692 2.333333337 Q 1.67307692 1.66666667 2.339743587 1.66666667 Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
bird_ic_statusbar_battery_70.xml
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="@dimen/bird_stat_sys_battery_width"
android:height="@dimen/bird_stat_sys_battery_height"
android:viewportWidth="30"
android:viewportHeight="10">
<path
android:fillColor="@color/bird_battry_normal_color"
android:fillType="evenOdd"
android:pathData="M 2.339743587 1.66666667 L 18.996410253 1.66666667 Q 19.66307692 1.66666667 19.66307692 2.333333337 L 19.66307692 7.666666673 Q 19.66307692 8.33333334 18.996410253 8.33333334 L 2.339743587 8.33333334 Q 1.67307692 8.33333334 1.67307692 7.666666673 L 1.67307692 2.333333337 Q 1.67307692 1.66666667 2.339743587 1.66666667 Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
bird_ic_statusbar_battery_80.xml
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="@dimen/bird_stat_sys_battery_width"
android:height="@dimen/bird_stat_sys_battery_height"
android:viewportWidth="30"
android:viewportHeight="10">
<path
android:fillColor="@color/bird_battry_normal_color"
android:fillType="evenOdd"
android:pathData="M 2.339743587 1.66666667 L 21.566410253 1.66666667 Q 22.23307692 1.66666667 22.23307692 2.333333337 L 22.23307692 7.666666673 Q 22.23307692 8.33333334 21.566410253 8.33333334 L 2.339743587 8.33333334 Q 1.67307692 8.33333334 1.67307692 7.666666673 L 1.67307692 2.333333337 Q 1.67307692 1.66666667 2.339743587 1.66666667 Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
bird_ic_statusbar_battery_90.xml
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="@dimen/bird_stat_sys_battery_width"
android:height="@dimen/bird_stat_sys_battery_height"
android:viewportWidth="30"
android:viewportHeight="10">
<path
android:fillColor="@color/bird_battry_normal_color"
android:fillType="evenOdd"
android:pathData="M 2.339743587 1.66666667 L 24.136410253 1.66666667 Q 24.80307692 1.66666667 24.80307692 2.333333337 L 24.80307692 7.666666673 Q 24.80307692 8.33333334 24.136410253 8.33333334 L 2.339743587 8.33333334 Q 1.67307692 8.33333334 1.67307692 7.666666673 L 1.67307692 2.333333337 Q 1.67307692 1.66666667 2.339743587 1.66666667 Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
bird_ic_statusbar_battery_95.xml
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="@dimen/bird_stat_sys_battery_width"
android:height="@dimen/bird_stat_sys_battery_height"
android:viewportWidth="30"
android:viewportHeight="10">
<path
android:fillColor="@color/bird_battry_normal_color"
android:fillType="evenOdd"
android:pathData="M 2.339743587 1.66666667 L 25.426410253 1.66666667 Q 26.09307692 1.66666667 26.09307692 2.333333337 L 26.09307692 7.666666673 Q 26.09307692 8.33333334 25.426410253 8.33333334 L 2.339743587 8.33333334 Q 1.67307692 8.33333334 1.67307692 7.666666673 L 1.67307692 2.333333337 Q 1.67307692 1.66666667 2.339743587 1.66666667 Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
bird_ic_statusbar_battery_100.xml
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="@dimen/bird_stat_sys_battery_width"
android:height="@dimen/bird_stat_sys_battery_height"
android:viewportWidth="30"
android:viewportHeight="10">
<path
android:fillColor="@color/bird_battry_normal_color"
android:fillType="evenOdd"
android:pathData="M 2.339743607 1.66666667 L 26.706410233 1.66666667 Q 27.37307692 1.66666667 27.37307692 2.333333357 L 27.37307692 7.666666653 Q 27.37307692 8.33333334 26.706410233 8.33333334 L 2.339743607 8.33333334 Q 1.67307692 8.33333334 1.67307692 7.666666653 L 1.67307692 2.333333357 Q 1.67307692 1.66666667 2.339743607 1.66666667 Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
具体的颜色和宽高可以根据自己实际情况来定义。