tarek360 / RichPath

💪 Rich Android Path. 🤡 Draw as you want. 🎉 Animate much as you can.

Home Page:https://twitter.com/a_tarek360

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Load Original SVG

tulaParekh opened this issue · comments

Hello,
Can we load original svg in richpath view?
I have put svg in Raw folder and without convert it into vector drawable file want to load in richpath.
is this possible?
Looking forward to hearing from you.
Thanks

Hi @tulaPivotal
No you can not load SVGs directly, you need to covnert it to VectorDrawable XML file at first and like any drawable file you have to add it to your drawable directory.

Hello,
Thanks for reply but while converting SVGs into VectorDrawable I couldn't find name of that path.
so is there any way to load SVGs with name?
Thanks

You are welcome!
You can add a name manually only for paths you want to control.

Hello,
I am loading SVG from URL so I can't add a name manually for path.
so what is other way to get a name for path?
Thanks

Do you load SVG in runtime?

So you can not use RichPath, to use RichPath you need to add your drawable.xml file to your res/drawable directory.
Please check the Readme file you will find some examples on how to use RichPath, also you can check the samples in the demo app.

yes, already I have checked. But I want to load SVG at runtime so how could I find richpath without any name?

In the readme file we mentioned two ways to find a richPath
You can use the second way, which is finding by index.

RichPath richPath = richPathView.findRichPathByIndex(0);

To know how does it work with nested groups of paths please check the docs of findRichPathByIndex() from here
https://github.com/tarek360/RichPath/blob/master/richpath/src/main/java/com/richpath/RichPathView.java#L165