-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Firework center has been added.
- Loading branch information
Showing
16 changed files
with
425 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ionexamples/ui/viewModel/BlinkCircleVM.kt → ...i/animations/blinkcircle/BlinkCircleVM.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...examples/ui/viewModel/CircleRotationVM.kt → ...ations/circlerotation/CircleRotationVM.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 1 addition & 4 deletions
5
...mples/ui/viewModel/ConfettiAnimationVM.kt → ...ons/confetticenter/ConfettiAnimationVM.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...ain/java/com/esatgozcu/animationexamples/ui/animations/fireworkcenter/FireworkCenterVM.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.esatgozcu.animationexamples.ui.animations.fireworkcenter | ||
|
||
import androidx.compose.ui.graphics.* | ||
import androidx.lifecycle.ViewModel | ||
import com.esatgozcu.animationexamples.helper.color | ||
import com.esatgozcu.animationexamples.ui.animations.confetticenter.SHAPES | ||
|
||
/// - Parameters: | ||
/// - pieceCount: amount of confetti | ||
/// - colors: list of colors that is applied to the default shapes | ||
/// - pieceSize: size that confetti and emojis are scaled to | ||
/// - radius: explosion radius | ||
/// - repetitions: number of repetitions of the explosion | ||
/// - repetitionInterval: duration between the repetitions | ||
class FireworkCenterVM( | ||
var pieceCount: Int = 20, | ||
var pieceType: List<FireworkTypes> = listOf( | ||
FireworkTypes.Shape(SHAPES.CIRCLE), | ||
), | ||
var colors: List<Color> = listOf( | ||
"#f88f22".color, | ||
"#9c1d08".color, | ||
"#ce7117".color, | ||
"#f24d24".color, | ||
"#113bc6".color, | ||
"#c54a85".color, | ||
"#92af96".color, | ||
"#d23508".color, | ||
), | ||
var pieceSize: Float = 5.0f, | ||
var radius: Float = 100f, | ||
var repetitions: Int = 0, | ||
var repetitionInterval: Double = 1000.0, | ||
var explosionAnimDuration: Double = 1200.0, | ||
var launchAnimDuration: Double = 3000.0, | ||
): ViewModel() { | ||
fun getAnimDuration(): Double { | ||
return explosionAnimDuration + launchAnimDuration | ||
} | ||
} | ||
|
||
sealed interface FireworkTypes { | ||
data class Image(val value: Int) : FireworkTypes | ||
data class Text(val value: String) : FireworkTypes | ||
data class Shape(val value: SHAPES) : FireworkTypes | ||
} |
Oops, something went wrong.