mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-18 12:18:48 +03:00
Update parameters
This commit is contained in:
parent
a0899477e9
commit
4f27ab263f
1 changed files with 15 additions and 22 deletions
|
@ -20,8 +20,13 @@ import android.content.Context
|
|||
import androidx.annotation.ColorInt
|
||||
import androidx.core.content.ContextCompat
|
||||
import im.vector.app.R
|
||||
import nl.dionsegijn.konfetti.core.Angle
|
||||
import nl.dionsegijn.konfetti.core.Party
|
||||
import nl.dionsegijn.konfetti.core.Position
|
||||
import nl.dionsegijn.konfetti.core.Spread
|
||||
import nl.dionsegijn.konfetti.core.emitter.Emitter
|
||||
import nl.dionsegijn.konfetti.core.models.Shape
|
||||
import nl.dionsegijn.konfetti.core.models.Size
|
||||
import nl.dionsegijn.konfetti.xml.KonfettiView
|
||||
|
||||
fun KonfettiView.play() {
|
||||
|
@ -35,33 +40,21 @@ fun KonfettiView.play() {
|
|||
R.color.palette_prune,
|
||||
R.color.palette_kiwi
|
||||
)
|
||||
/*
|
||||
build()
|
||||
.addColors(confettiColors.toColorInt(context))
|
||||
.setDirection(0.0, 359.0)
|
||||
.setSpeed(2f, 5f)
|
||||
.setFadeOutEnabled(true)
|
||||
.setTimeToLive(2000L)
|
||||
.addShapes(Shape.Square, Shape.Circle)
|
||||
.addSizes(Size(12))
|
||||
.setPosition(-50f, width + 50f, -50f, -50f)
|
||||
.streamFor(150, 3000L)
|
||||
*/
|
||||
|
||||
val emitterConfig = Emitter(2000).perSecond(100)
|
||||
val party = Party(
|
||||
emitter = emitterConfig,
|
||||
colors = confettiColors.toColorInt(context),
|
||||
/*
|
||||
// Keep other default setting for now.
|
||||
timeToLive = 2000L,
|
||||
fadeOutEnabled = true,
|
||||
angle = Angle.Companion.BOTTOM,
|
||||
spread = Spread.ROUND,
|
||||
shapes = listOf(Shape.Square, Shape.Circle),
|
||||
size = listOf(Size(12)),
|
||||
speed = 2f,
|
||||
maxSpeed = 5f,
|
||||
damping = 0.9f,
|
||||
spread = 360,
|
||||
position = Position.Relative(0.5, 0.3),
|
||||
*/
|
||||
emitter = Emitter(duration = 100).max(100)
|
||||
fadeOutEnabled = true,
|
||||
timeToLive = 2000L,
|
||||
position = Position.Relative(0.0, 0.0).between(Position.Relative(1.0, 0.0)),
|
||||
)
|
||||
reset()
|
||||
start(party)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue