Skip to content

A repository to allows finding inner parts of VectorDrawable, and perform operations on them, based on VectorChildFinder repository

License

Notifications You must be signed in to change notification settings

AndroidDeveloperLB/VectorChildFinder

Repository files navigation

VectorChildFinder

A repository to allows finding inner parts of VectorDrawable, and perform operations on them, based on VectorChildFinder repository and a fork of it :

The need of this was because these are missing features, you can't extend/customize anything in the framework/support-library to add them, and you can't use reflection to reach the various fields&methods of it, either (because of Android security).

Advantages over VectorDrawable&VectorDrawableCompat :

  1. Can find paths/groups by name, apply what you wish on them.
  2. Can traverse entire hirerchy and apply what you wish on any node there.
  3. Can add click-listener for paths of your choice.
  4. Due to always using the same inflation technique of the VectorDrawableCompat, no matter the API, this should work the same for all Android versions.

Disadvantages:

As it's based on an old library, which is based on old code of VectorDrawableCompat, which can't deal with certain things that were added later, such as gradient:

Because of this, I hope one day VectorDrawable/VectorDrawableCompat would allow the same capabilities as I've presented here. I've created requests for each:

Usage

Same as the original ones, but with a bit more functionality that I've shown on the sample. Also, to use in gradle file, have it as such:

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

dependencies {
    implementation 'com.github.devsideal:VectorChildFinder:#'
 }

This is done via Jitpack: https://jitpack.io/#AndroidDeveloperLB/VectorChildFinder

About

A repository to allows finding inner parts of VectorDrawable, and perform operations on them, based on VectorChildFinder repository

Resources

License

Stars

Watchers

Forks

Packages

No packages published