PaintableVectorView enables to change color of paths/groups in Vector Drawable (SVG)

Overview

PaintableVectorView

PaintableVectorView enables to change color of paths/groups in Vector Drawable (SVG)

Demo

Alt Text

Car icon made by Prosymbols from www.flaticon.com

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()

License

Copyright 2019 Jakub Aniola

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You might also like...
Library containing over 2000 material vector icons that can be easily used as Drawable or as a standalone View.
Library containing over 2000 material vector icons that can be easily used as Drawable or as a standalone View.

Material Icon Library A library containing over 2000 material vector icons that can be easily used as Drawable, a standalone View or inside menu resou

Android Studio's Vector Drawable conversion tool in convenient packaging.

Vector Drawable Tool This repository is simply a repackaging of the vector drawable tool from the Android Studio source code. The included Gradle file

🎨 Jetpack Compose canvas library that helps you draw paths, images on canvas with color pickers and palettes
🎨 Jetpack Compose canvas library that helps you draw paths, images on canvas with color pickers and palettes

🎨 Jetpack Compose canvas library that helps you draw paths and images on canvas with color pickers and palettes. Sketchbook also provides useful components and functions that can easily interact with canvas.

🎨 A color picker for Android. Pick a color using color wheel and slider (HSV & alpha).
🎨 A color picker for Android. Pick a color using color wheel and slider (HSV & alpha).

ColorPicker English | 中文 A ColorPicker for Android. Pick a color using color wheel and slider (HSV & alpha). Gradle dependencies { implementation

Use a jar executable to create a Drawable class to display a SVG on Android.
Use a jar executable to create a Drawable class to display a SVG on Android.

SVG2Drawable Use a jar executable to create a Drawable class to display a SVG on Android. This is a standalone library, not a Runtime Android library.

Use a jar executable to create a Drawable class to display a SVG on Android.
Use a jar executable to create a Drawable class to display a SVG on Android.

SVG2Drawable Use a jar executable to create a Drawable class to display a SVG on Android. This is a standalone library, not a Runtime Android library.

🛠️ The missing drawable toolbox for Android. Create drawables programmatically and get rid of the boring and always repeated drawable.xml files.
🛠️ The missing drawable toolbox for Android. Create drawables programmatically and get rid of the boring and always repeated drawable.xml files.

DrawableToolbox English | 中文 The missing DrawableToolbox for Android. Create drawables programmatically and get rid of the boring and always repeated

Some beautiful android loading drawable, can be combined with any view as the LoadingView or the ProgressBar. Besides, some Drawable can customize the loading progress too.
Some beautiful android loading drawable, can be combined with any view as the LoadingView or the ProgressBar. Besides, some Drawable can customize the loading progress too.

LoadingDrawable: Android cool animation collection 前言 CircleRotate源码解析 Fish源码解析 LoadingDrawable is some android animations implement of drawable: a li

Easy and quick contact management with no ads, handles groups and favorites too.
Easy and quick contact management with no ads, handles groups and favorites too.

Simple Contacts A simple app for creating or managing your contacts from any source. The contacts can be stored on your device only, but also synchron

Gradle plugin that parses version updates and assigns them to groups of people.

Notifier Gradle Plugin This gradle plugin serves the need of automating how dependencies are handles in a project. More specifically, it functions usi

Simple example how you can use dynamic color image vector in your app.
Simple example how you can use dynamic color image vector in your app.

Dynamic Color ImageVector Simple example how you can use dynamic color image vector in your app. How to use 1. Create a xml image vector The content o

Simple View to change Brush Size, Alpha and Color
Simple View to change Brush Size, Alpha and Color

BrushView Simple View to change Brush Size, Alpha and Color Screenshots How to install In your build.gradle project allprojects { repositories {

An application with the use of Kotlin can change the color of the text, and the background with the press of a button and switch.
An application with the use of Kotlin can change the color of the text, and the background with the press of a button and switch.

An application with the use of Kotlin can change the color of the text, and the background with the press of a button and switch.

Android Library to handle multiple Uri's(paths) received through Intents.
Android Library to handle multiple Uri's(paths) received through Intents.

📚 Handle Path Oz Android library written in Kotlin, but can be used in Java too. Built to handle a single or multiple Uri (paths) received through In

A set of APIs to manipulate graphics paths on Android

Pathway Pathway is an Android library that provides new functionalities around the graphics Path API. Pathway is compatible with API 21+. Maven reposi

🗺 Android Developer Roadmap 2022 suggests learning paths to understanding Android development.
🗺 Android Developer Roadmap 2022 suggests learning paths to understanding Android development.

Android Developer Roadmap 2022 English | 한국어 Android Developer Roadmap 2022 suggests learning paths to understanding Android development. You can read

🗺 Android Developer Roadmap 2022 suggests learning paths to understanding Android development.
🗺 Android Developer Roadmap 2022 suggests learning paths to understanding Android development.

🗺 Android Developer Roadmap 2022 suggests learning paths to understanding Android development.

UTBotJava generates test cases by code, trying to cover maximum statements and execution paths.

UTBotJava generates test cases by code, trying to cover maximum statements and execution paths. We treat source code as source of truth assuming that behavior is correct and corresponds to initial user demand. Generated tests are placed in so-called regression suite

PenPath class is designed to be used to draw paths with variable thickness
PenPath class is designed to be used to draw paths with variable thickness

PenPath class is designed to be used to draw paths with variable thickness. It creates an object of android.graphics.Path and should be drawn with Paint.Style.FILL type paint.

Comments
  • Replace Path

    Replace Path

    Hi Buddy, I like the lib, thanks for giving to images this kind of approach. I need to ask one thing that can we put another path in the place of the existing path in the same size or ratio. for car example, I need to put eyes on the place of headlights of car, can I go for this approach? @bardss

    enhancement 
    opened by UmeshJangid 0
  • Question: can this be used to export to VectorDrawable XML

    Question: can this be used to export to VectorDrawable XML

    This can be nice to edit the files and find exactly what needs to be changed to another color. It could even be cooler if you'd have it in Android Studio, so that we could edit not just the XML, but press on the parts of the preview, and then it will go directly to the XML part of it.

    enhancement 
    opened by AndroidDeveloperLB 0
Owner
Jakub Anioła
Hey, I'm student and programmer from Poznan, Poland. I like Android.
Jakub Anioła
🍭🚀💗 Tutorials about animations with Animators, Animated Vector Drawables, Shared Transitions, and more

?????? Tutorials about animations with Animators, Animated Vector Drawables, Shared Transitions, and more

Smart Tool Factory 696 Dec 28, 2022
create your custom themes and change them dynamically with ripple animation

Android Animated Theme Manager create your custom themes and change them dynamically with ripple animation Features support java and kotlin projects.

Iman Dolatkia 601 Dec 22, 2022
Android view with both path from constructed path or from svg.

android-pathview You want to animate svg or normal Paths?<br> Change the color, pathWidth or add svg.<br> Animate the "procentage" property to make th

Georgi Eftimov 2.9k Dec 30, 2022
Road Runner is a library for android which allow you to make your own loading animation using a SVG image

Road Runner Road Runner is a library for android which allow you to make your own loading animation using a SVG image Sample video View in Youtube Dem

Adrián Lomas 1.2k Nov 18, 2022
This a demo application with animated SVG animation of Smiley

Animated-Smiley-Rating Animated Customer feedback and rating UI ?? License Copyright 2021 Aiman Muzafar Licensed under the Apache License, Version 2.0

Aiman Muzafar 12 Aug 12, 2021
🎨 Android colorpicker for getting colors from any images by tapping on the desired color.

ColorPickerView ?? ColorPickerView implements getting HSV colors, ARGB values, Hex color codes from any image drawables or your gallery pictures by ta

Jaewoong Eum 1.3k Jan 8, 2023
Android-Iconics - Use any icon font, or vector (.svg) as drawable in your application.

Android-Iconics ... allows to include any icon font with all its vector icons in your project. No limits. Scale with no limit, use any color at any ti

Mike Penz 5k Jan 5, 2023
Transforms a Vector Drawable or a SVG path to a Compose ImageVector

Svg2Compose Transforms a Vector Drawable or a SVG path to a Compose ImageVector. Download Download the latest version (Windows) here: Releases. How to

Denis Mondon 18 Dec 22, 2022
Converts SVG and Android Vector Drawable in Jetpack Compose code

SVG to Compose [Experimental] Converts SVG or Android Vector Drawable to Compose code. Android Studio/IntelliJ plugin by overpass Why this project On

Gabriel Souza 244 Dec 26, 2022
Android fillable progress view working with SVG paths. This is a nice option too if you want to create an interesting branding logo for your app. Based on the iOS project: https://github.com/poolqf/FillableLoaders

Android FillableLoaders Android Open Source library providing an interesting fillable progress view working with SVG paths. This is a nice option too

Jorge Castillo 2k Jan 1, 2023