v1.2.0
Added
- (#129) Add custom drawables as confetti thanks to @mattprecious
Changes
Minor API change, old ones still work due to backwards compatibility.
Before | Becomes |
---|---|
Shape.RECT | Shape.Square |
Shape.CIRCLE | Shape.Circle |
Add a custom drawable like this:
val drawable = ContextCompat.getDrawable(context, R.drawable.star)
val star = Shape.DrawableShape(drawable)
viewKonfetti.build()
...
.addShapes(star)
.streamFor(300, 5000L)
If you want to keep the original colours of the drawable set tinting to false. This is by default set to true.
val drawable = ContextCompat.getDrawable(context, R.drawable.gradientDrawable)
Shape.DrawableShape(drawable, false)