ShimmerLayout
ShimmerLayout copied to clipboard
incorrect behaviour + memory leak fix
I found that if we call startAnimation more then once when the view has 0 size we will add 2 PreDrawListeners.
And everything was ok except the case when I cancel shimmer animation before the view size change. In this case - animation will start anyway because stopShimmerAnimation
will remove only latest PreDrawListener. In this case animation will start anyway.
The second thing - if I navigate back too quick I've noticed that I have a warning about memory leak from LeakCanary. And during the debug found that there can be a case when this PreDrawListener will fire without cancelling and animation will run even if the view is detached.
This PR should fix https://github.com/team-supercharge/ShimmerLayout/issues/75
well, above check shows error not for the PR content but for setup and license acceptance.
hey @veghtomi can you check this PR?
is this project live? any feedback here? @veghtomi
hey @szugyi as I can see you are the last guy who committed to this repository, so I'm going to ping you here. I have a deadline and if no one answer I will have to clone the repo to the project and include source code to fix this issue.
Sorry for the late reply. This project is pretty much deprecated, as Facebook has improved their implementation of the Shimmering effect quite a lot since this alternative has been published. I would suggest migrating to that library. https://github.com/facebook/shimmer-android
Thanks for the answer here @szugyi
The bad thing for me now that we have this dependency too https://github.com/ethanhua/Skeleton and this library is based on yours. For now it seems that your solution works pretty good for now - the only issue is this bug. I will think about migration but anyway will you have a chance to review, merge and publish this PR or you don't have time for that now?
Regards, Mikhail
Sorry, but I cannot release new versions. The best option is to make the change you need and use it as source, or release the fix in your own nexus repository.