@@ -203,8 +203,8 @@ import kotlinx.coroutines.flow.map
203
203
import kotlinx.coroutines.flow.onEach
204
204
import kotlinx.coroutines.launch
205
205
import kotlinx.coroutines.withContext
206
- import nl.dionsegijn.konfetti.models.Shape
207
- import nl.dionsegijn.konfetti.models.Size
206
+ import nl.dionsegijn.konfetti.core.Party
207
+ import nl.dionsegijn.konfetti.core.emitter.Emitter
208
208
import org.billcarsonfr.jsonviewer.JSonViewerDialog
209
209
import org.commonmark.parser.Parser
210
210
import org.matrix.android.sdk.api.session.Session
@@ -559,16 +559,21 @@ class TimelineFragment @Inject constructor(
559
559
when (chatEffect) {
560
560
ChatEffect .CONFETTI -> {
561
561
views.viewKonfetti.isVisible = true
562
- views.viewKonfetti.build()
563
- .addColors(Color .YELLOW , Color .GREEN , Color .MAGENTA )
564
- .setDirection(0.0 , 359.0 )
565
- .setSpeed(2f , 5f )
566
- .setFadeOutEnabled(true )
567
- .setTimeToLive(2000L )
568
- .addShapes(Shape .Square , Shape .Circle )
569
- .addSizes(Size (12 ))
570
- .setPosition(- 50f , views.viewKonfetti.width + 50f , - 50f , - 50f )
571
- .streamFor(150 , 3000L )
562
+ val party = Party (
563
+ /*
564
+ // Keep default setting for now.
565
+ colors = listOf(Color.YELLOW, Color.GREEN, Color.MAGENTA),
566
+ timeToLive = 2000L,
567
+ fadeOutEnabled = true,
568
+ speed = 2f,
569
+ maxSpeed = 5f,
570
+ damping = 0.9f,
571
+ spread = 360,
572
+ position = Position.Relative(0.5, 0.3),
573
+ */
574
+ emitter = Emitter (duration = 100 ).max(100 )
575
+ )
576
+ views.viewKonfetti.start(party)
572
577
}
573
578
ChatEffect .SNOWFALL -> {
574
579
views.viewSnowFall.isVisible = true
0 commit comments