geftimov / android-pathview

Android view with both path from constructed path or from svg.
Apache License 2.0
2.91k stars 513 forks source link

How to do reversed animation? #31

Closed lion4ik closed 7 years ago

lion4ik commented 7 years ago

I mean animate from drawn state to erased state. Actually, I want to do cyclic animation for progress loader, which will be animate painting then animate erasing then again painting and then erasing and so on... Could you give me a hint how to do it ?

geftimov commented 7 years ago

Actually I did something like that. Instead of using the animations you must set the progress yourself. The call is:

pathView.setPercentage(0.5f);

This will give you exactly half of the svg path animation, so you can hook it up with something that is changing that value from 0 to 1 and then from 1 to 0. Should be easy.