0

I'm using SVG rendering library for Android create a drawable vector by parsing SVG. Then I want to identify elements of it and make them fillable.

For example I want to identify all six elements separately in the SVG file as follows and I want to make them fillable.

enter image description here

What is the appropriate way to do this?

Paul LeBeau
  • 97,474
  • 9
  • 154
  • 181
isuru
  • 3,385
  • 4
  • 27
  • 62

1 Answers1

0

AndroidSVG is currently render-only. So you can't modify the SVG or recolour any part of it and re-render.

I see two solutions:

  1. Load your SVG in as a string. Then recolour your image by modifying the SVG using string manipulations, then pass it to AndroidSVG via an InputStream.

  2. Have a stack of seven SVGs. One for each petal colour and the flower outline on top. Then make each petal visible as the right area is clicked on.

Paul LeBeau
  • 97,474
  • 9
  • 154
  • 181