File tree Expand file tree Collapse file tree
konfetti/compose/src/main/java/nl/dionsegijn/konfetti/compose Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,12 +2,12 @@ package nl.dionsegijn.konfetti.compose
22
33import android.content.res.Resources
44import android.graphics.drawable.Drawable
5+ import androidx.compose.animation.core.withInfiniteAnimationFrameMillis
56import androidx.compose.foundation.Canvas
67import androidx.compose.runtime.Composable
78import androidx.compose.runtime.LaunchedEffect
89import androidx.compose.runtime.mutableStateOf
910import androidx.compose.runtime.remember
10- import androidx.compose.runtime.withFrameMillis
1111import androidx.compose.ui.Modifier
1212import androidx.compose.ui.geometry.Offset
1313import androidx.compose.ui.graphics.drawscope.withTransform
@@ -58,7 +58,7 @@ fun KonfettiView(
5858 )
5959 }
6060 while (true ) {
61- withFrameMillis { frameMs ->
61+ withInfiniteAnimationFrameMillis { frameMs ->
6262 // Calculate time between frames, fallback to 0 when previous frame doesn't exist
6363 val deltaMs = if (frameTime.value > 0 ) (frameMs - frameTime.value) else 0
6464 frameTime.value = frameMs
You can’t perform that action at this time.
0 commit comments