Celebrate more with this lightweight confetti particle system
Konfetti
Celebrate more with this lightweight confetti particle system :confetti_ball: Create realistic confetti by implementing this easy to use library.
Usage
XML
All you need in your layout is the KonfettiView to render the particles on:
<nl.dionsegijn.konfetti.KonfettiView
android:id="@+id/viewKonfetti"
android:layout_width="match_parent"
android:layout_height="match_parent" />
Example
viewKonfetti.build()
.addColors(Color.YELLOW, Color.GREEN, Color.MAGENTA)
.setDirection(0.0, 359.0)
.setSpeed(1f, 5f)
.setFadeOutEnabled(true)
.setTimeToLive(2000L)
.addShapes(Shape.RECT, Shape.CIRCLE)
.addSizes(Size(12))
.setPosition(-50f, viewKonfetti.width + 50f, -50f, -50f)
.stream(300, 5000L)
Download
Just add the following dependency in your app's build.gradle
dependencies {
compile 'nl.dionsegijn:konfetti:1.1.0'
}