BigBadaboom / androidsvg

SVG rendering library for Android
http://bigbadaboom.github.io/androidsvg/
Apache License 2.0
1.21k stars 231 forks source link

Make SVG.getRootElement public #243

Closed sgallego closed 2 years ago

sgallego commented 2 years ago

Please, make SVG.getRootElement public so we can access elements tree and manage it for other purposes, not only for rendering. make public also SvgObject and its subclasses,

Thanks,

BigBadaboom commented 2 years ago

Hi

This would happen as part of #130. Are you asking for something different from what that issue proposes?

sgallego commented 2 years ago

Hi, I ask for something more simple, only to read SvgObject tree but, as you comment, this could be part of #130. Thanks.

BigBadaboom commented 2 years ago

Partial duplicate of #130

BigBadaboom commented 2 years ago

Ok. I am going to mark this as a duplicate then.

If you need this urgently, there are a couple of ways you can do it yourself.

  1. Fork the repo and implement the method yourself. Then use your custom build.
  2. Use reflection to access that method, or the field it returns. Example here

I hope this is helpful for you until I get the chance to work on #130..

sgallego commented 2 years ago

Hi, I have tried 2, but I cannot do it because received objects are package private, so I cannot use them. I have make a test with a fork and it works fine. I will do a pull request when I work more than for a test. Thanks again.

BigBadaboom commented 2 years ago

Hi

Thanks for offering a patch. But I probably wouldn't accept it. I am reluctant to add a method that exposes internal objects, and will go away before very long.

I would prefer to wait until I can properly implement it as part of #130.