Skip to content

Instantly share code, notes, and snippets.

@AidaIssayeva
AidaIssayeva / Flying Hearts Composable function in Jetpack Compose
Created February 27, 2022 04:45
Flying Hearts Animation in jetpack Compose
@OptIn(ExperimentalAnimationApi::class)
@Composable
fun Heart(modifier: Modifier, horizontalPadding: Int, bottomMargin: Int) {
val width = LocalConfiguration.current.screenWidthDp
val height = LocalConfiguration.current.screenHeightDp - bottomMargin
val yRandom = Random.nextInt(0, height / 2)
val xRandom = Random.nextInt(horizontalPadding, (width - horizontalPadding))
val state = remember {
@alairock
alairock / exceptions.py
Last active August 26, 2024 14:45
Python Async Retry Decorator.
class TooManyTriesException(BaseException):
pass