PaintableVectorView enables to change color of paths/groups in Vector Drawable
PaintableVectorView
PaintableVectorView enables to change color of paths/groups in Vector Drawable (SVG).
Dependency
Add the following lines in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add the dependency
dependencies {
implementation 'com.github.bardss:PaintableVectorView:1.0.0'
}
Usage
Create PaintableVectorView and add to the layout:
val paintableView = PaintableVectorView(
context = this,
drawableId = R.drawable.ic_car,
paintType = PaintType.PAINT_PATH,
paintColor = resources.getColor(R.color.blue)
)
layout.addView(paintableView)
Set other paint type:
paintableView.paintType = PaintType.PAINT_GROUP
Set other paint color:
paintableView.paintColor = resources.getColor(R.color.blue)
Reset layers color in PaintableVectorView:
paintableView.resetColors()