Repository navigation
Releases
v2.2.0
New
- (#327) Added stars, triangles and diamonds
Shape.Polygon.STAR,Shape.Polygon.TRIANGLEandShape.Polygon.DIAMONDspin and flip just like the other shapes. Make a star with more points withShape.Polygon.star(points = 6), or draw your own polygon from points. Thanks to @patxibocos for the triangle that got this started - Respect "Remove animations" in the accessibility settings.
rememberReduceMotion()in Compose andKonfettiView.isReduceMotionEnabled(context)for views tell you when it's on, so you can skip the confetti. Nothing changes unless you check it
Heads up: Shape is a sealed interface, so if you have an exhaustive when (shape) in your own code, it needs a branch for Shape.Polygon now.
v2.1.0
New
- (#305) Starting confetti from a button in Compose is finally easy.
rememberKonfettiState()gives youstart,burst(at = offset),stopGracefullyandreset, and you pass it toKonfettiView(state = ...). No morekey()orrepeattricks. Thanks to @zoltish for asking and @svenjacobs for the idea to burst where the user taps KonfettiView(state = ...)takes anonPartyEnded = { activeParties -> }lambda that's called once for every party that finishes
Changed
- (#320)
KonfettiView(parties = ...)now starts over when the list of parties changes. Before, it only ever played the first list it got. Thanks to @behu-kea for reporting this
Heads up: the parties are compared with equals, so if you build them inside a composable, wrap them in remember. A party with a drawable you load with getDrawable(...) on every recomposition counts as new each time and would restart. Parties with squares, circles and rectangles are fine.
Other
- The size and speed of the confetti follow
LocalDensity, so they match the rest of your Compose UI on other displays and in previews - The Compose sample uses the new state API, tap anywhere for a burst
v2.0.8
Fixes
- (#304, #269)
Emitter.max()with an amount bigger than the duration in milliseconds rounded down to an endless burst and could run the app out of memory. It now never creates more than the max you set. Thanks to @NKosyanchuk and @HolyShot for reporting it and @tim4724 for finding the cause - (#297) Fix the crash on API 21 and 22 when the XML
KonfettiViewshows up. Thanks to @ouchadam for reporting it - (#337)
konfetti-composeandkonfetti-xmlcan be used in the same app again. The shared image classes now live in a newkonfetti-imageartifact that comes in automatically, and your imports stay the same. Thanks to @spinkarad for reporting it - (#330) Confetti is drawn as long as any part of it is on screen, so pieces no longer pop in at the edges. Thanks to @mattprecious for reporting it
- In Compose,
onParticleSystemEndednow fires once per party instead of every frame, andKonfettiViewstops requesting frames when it's done
Other
- The XML view caps one frame at 100ms too, the same as Compose
- Using the same drawable with and without
tintno longer leaks the tint into the other shape
v2.0.7
Fixes
- (#349) Sometimes when you background the app while confetti is still spawning in Compose, coming back treats the whole pause as one frame. With 50 particles a second, a minute away tries to create about 3000 particles at once. That can freeze the app or run out of memory. The saved frame time is now cleared when the view resumes, and one frame is capped at 100ms so a stall can't dump the whole party either.
Thanks to @mekutluca and @PaulKlauser for raising this (#340, #341, #342)
Other
- The license name in the published POM is now
ISC, so Maven and Licensee can recognize it. Thanks to @rodgavila and @eygraber for raising this (#339, #344) PartySystemcan take aRandom. The old constructor still works, and a seeded one creates the same particles every time
v2.0.6
No API changes in this release. I bumped the build tooling so Konfetti can keep being published. The project was still on an old Gradle, AGP and Kotlin setup, and the old Sonatype OSSRH host is no longer around.
Other
- Upgrade Gradle to 9.6, AGP to 9.4.1 and Kotlin from 1.8.10 to 2.4.21
v2.0.5
Fixes
- (#333) and issue #306 Replace withFrameMillis with withInfiniteAnimationFrameMillis - fixes instrumentation tests with Konfetti-compose implementation in them (
Idling resource timed out: possibly due to compose being busy.)
Thanks to @crowleysimon and @lupuuss for investigating this issue and @matthewbartos for getting it on my radar
v2.0.4
Fixes
- (#319) Fix rendering by dynamically updating FPS instead of locking it to 60fps. Phones that had a refresh rate of 120hz experienced a rendering speed that was two times faster. The experience should now be consistent across different frame rates.
v2.0.3
Fixes
- (#309) Introducing
applyAlphato turn off Alpha forDrawableShapes. This fixes an issue for non-tinted (DrawableShape, tint = false) when alpha is applied. by @laurentyhuel. - (#301) Fixing an alpha issues for DrawableShapes in the compose SDK causing them to flicker. @dostalleos
Other
- Upgrade AGP, Kotlin and other dependencies @DanielMartinus
v2.0.2
Fixes
- (#287) Lower minSdk for konfetti-compose to api 21
- (#288) Fix Out of Memory exception by @PaulKlauser
- (#295) Improve transitive dependency setup
v2.0.1
This is a patch for the 2.0.0 release. Core classes weren't exposed making the library unusable and it includes some other small fixes that shouldn't have end up in a release.
Fixes
- (#284) Include core classes in
konfetti-xmlandkonfetti-compose. Thanks @GhislainVerrier for reporting the issue - (2878993) Remove log from core library
- (2da7554) Remove unused compose dependencies and replace them with foundation 8822323