#Android SVG 矢量圖做主題換膚
##Step 1. Add the JitPack repository to your build file
```java
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
##Step 2. Add the dependency
```java
dependencies {
implementation 'com.github.wy749814530:SvgImageView:1.1.1'
}
```
##Step 3
```java
<com.svg.SvgImageView
android:id="@+id/svgImageView"
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_margin="18dp"
appL:image="@drawable/ic_car"
/>
SvgImageView svgImageView = findViewById(R.id.svgImageView);
/**
* 修改圖層顏色
*
* @param view
*/
svgImageView.setGroupColorByIndex(0, getResources().getColor(R.color.colorAccent));
/**
* 修改Path顏色
*
* @param view
*/
svgImageView.setPathColorByIndex(0, getResources().getColor(R.color.colorAccent));
/**
* 修改所以Path顏色
*
* @param view
*/
svgImageView.setPathsColor(getResources().getColor(R.color.colorAccent));
/**
* 還原SVG圖原始色
*
* @param view
*/
public void onRestore(View view) {
svgImageView.resetColors();
}
```