confetti icon indicating copy to clipboard operation
confetti copied to clipboard

Add a limit option to the number of confetti on screen

Open magneticflux- opened this issue 6 years ago • 2 comments

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.

magneticflux- avatar Jul 12 '17 01:07 magneticflux-

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.

jinatonic avatar Jul 27 '17 21:07 jinatonic

@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.

magneticflux- avatar Jul 28 '17 16:07 magneticflux-