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

Add a limit option to the number of confetti on screen #26

Open
magneticflux- opened this issue Jul 12, 2017 · 2 comments
Open

Add a limit option to the number of confetti on screen #26

magneticflux- opened this issue Jul 12, 2017 · 2 comments

Comments

@magneticflux-
Copy link
Contributor

You can use some of the Guava caches here to optimize your confetto recycling and limit the number of active confetti on-screen.
This should be completely configurable, since some devices are more powerful than others. The animator could keep track of the last frame-time and also dynamically adjust the value.

@jinatonic
Copy link
Owner

I want to avoid pulling in other libraries for this project to keep down the dex / apk impact of the library. We can build more configurable caching mechanism into the library if you have a use-case for it.

@magneticflux-
Copy link
Contributor Author

@jinatonic I understand not wanting to include more libraries, and I think the same thing could be accomplished by checking the size of the queue for recycled confetti compared to some limit value.

My use case would be as a safeguard against straining the user's device. It can be hard to gauge how many confetti will be onscreen at once just from the emission rate, so having an absolute max is useful to prevent absurd values from lagging the animation.

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

No branches or pull requests

2 participants