Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incorrect behaviour + memory leak fix #87

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mig35
Copy link

@mig35 mig35 commented Mar 18, 2020

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 #75

@mig35
Copy link
Author

mig35 commented Mar 18, 2020

well, above check shows error not for the PR content but for setup and license acceptance.

@mig35
Copy link
Author

mig35 commented Mar 20, 2020

hey @veghtomi
can you check this PR?

@mig35
Copy link
Author

mig35 commented Mar 23, 2020

is this project live? any feedback here?
@veghtomi

@mig35
Copy link
Author

mig35 commented Mar 25, 2020

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.

@szugyi
Copy link
Member

szugyi commented Mar 26, 2020

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

@szugyi szugyi requested a review from veghtomi March 26, 2020 09:25
@mig35
Copy link
Author

mig35 commented Mar 26, 2020

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

@szugyi
Copy link
Member

szugyi commented Mar 26, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Facing memory leaks and hanging UI using IO shimmer
2 participants