I know that using a third-party library, you can use the SVG image in Android. Library like: svg-android
The code for uploading an SVG image is as follows:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
Works fine. I can see the image. But now I want to change the color of the SVG image at runtime. To do this, I tried the code below, as indicated in the same project description.
// 0xFF9FBF3B is the hex code for the existing Android green, 0xFF1756c9 is the new blue color SVG svg = SVGParser.getSVGFromResource(getResources(), R.raw.android, 0xFF9FBF3B, 0xFF1756c9);
But with this I can not see the changes in color. Therefore, I would like to know how to dynamically change color in a Java file.
android svg android-view imageview svg-filters
iDroid Explorer
source share