Skip to content

Instantly share code, notes, and snippets.

@ilyasipek
ilyasipek / CounterAnimationRow.kt
Created January 18, 2024 18:20
CounterAnimationRow
@Composable
fun CounterAnimationRow(
count: Int,
modifier: Modifier = Modifier,
charComposable: @Composable RowScope.(Char) -> Unit,
) {
var oldCount by remember { mutableIntStateOf(count) }
val increasingValueContentTransform = remember {
slideInVertically { -it } + fadeIn() togetherWith slideOutVertically { it } + fadeOut()
}