ozodrukh / CircularReveal

Lollipop ViewAnimationUtils.createCircularReveal for everyone 4.0+
MIT License
2.43k stars 391 forks source link

No reverse() in v2.0.1 #88

Closed mohakapt closed 7 years ago

mohakapt commented 8 years ago

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?

ozodrukh commented 8 years ago

No noway, only manually by reversing values

amanzan commented 8 years ago

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

ozodrukh commented 8 years ago

@amanzan Previous implementation was really poor and confusing, I decided to remove it,im sorry for inconvenience 😔

amanzan commented 8 years ago

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 👍 :)

ozodrukh commented 8 years ago

@amanzan Thank you for support 😉 well you can look how it was implemented before in commit history

Spotik commented 8 years ago

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

ozodrukh commented 8 years ago

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()
pedrosoares commented 8 years ago

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);