Skip to content

Commit 6dbc42e

Browse files
Merge pull request #333 from lupuuss/compose-konfetti-view-tests-support
Replace withFrameMillis with withInfiniteAnimationFrameMillis to run …
2 parents 6183596 + c4ccd6b commit 6dbc42e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • konfetti/compose/src/main/java/nl/dionsegijn/konfetti/compose

konfetti/compose/src/main/java/nl/dionsegijn/konfetti/compose/KonfettiView.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ package nl.dionsegijn.konfetti.compose
22

33
import android.content.res.Resources
44
import android.graphics.drawable.Drawable
5+
import androidx.compose.animation.core.withInfiniteAnimationFrameMillis
56
import androidx.compose.foundation.Canvas
67
import androidx.compose.runtime.Composable
78
import androidx.compose.runtime.LaunchedEffect
89
import androidx.compose.runtime.mutableStateOf
910
import androidx.compose.runtime.remember
10-
import androidx.compose.runtime.withFrameMillis
1111
import androidx.compose.ui.Modifier
1212
import androidx.compose.ui.geometry.Offset
1313
import 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

0 commit comments

Comments
 (0)