Android library about overriding resources

If I create a library and add the usual drawable int drawable-xxhdpi, then add a resource file with the same name in the app.the application. Reasource will replace the library resource like:

enter image description here

But if I use the svg resource, it will not replace the library resource, for example:

enter image description here

How to replace a vector drawing?

+7
android vector drawable svg
source share
1 answer

During assembly, vector drawings from the library are placed in the drawable-anydpi-v21 folder .

Since this will have a precedent for all v21 + devices, you need to move the application to one folder if you want to override the library resource.

For pre-v21 you need to set vectorDrawables.useSupportLibrary = true in the library and application and put the vector in the drawable folder.

+5
source share

All Articles