ozodrukh/CircularReveal

No reverse() in v2.0.1

mohakapt opened this issue ยท 8 comments

Hi, I just updated to version 2.0.1, looks like reverse() has been removed in this version.
It is possible to reverse animation in this new version?

No noway, only manually by reversing values

If I may ask, what's the point of removing reverse() method?

@amanzan Previous implementation was really poor and confusing, I decided to remove it,im sorry for inconvenience ๐Ÿ˜”

No problem, I'm using that method and it has been working just fine so far. I'm sure I'll find an alternative with this new version when I decide to upgrade. Thanks so much for this library, by the way ๐Ÿ‘ :)

@amanzan Thank you for support ๐Ÿ˜‰ well you can look how it was implemented before in commit history

@ozodrukh could u make a gist with the implementation to reverse? Or just reverse the values rly work?

Well on Lollipop and higher where native animation is used, it looks like you don't have reverse ability.

By using compat version (Pre Lollipop) cast it to ValueAnimator and use one of this methods

  1. ValueAnimator.setRepeatMode()
  2. ValueAnimator.reverse()

My reverse i do in this way:
Animator animator = ViewAnimationUtils.createCircularReveal(attachmentLayout, cx, cy, 0, radius);
Animator animatorReverse = ViewAnimationUtils.createCircularReveal(attachmentLayout, cx, cy, radius, 0);