PreCompose icon indicating copy to clipboard operation
PreCompose copied to clipboard

Version 1.5.10 breaks animation progress inside screen

Open KostadinAlmishev opened this issue 2 years ago • 3 comments

New version 1.5.10 resets animation progress inside screen. In the example, progress indicator is animated from 0 to 1. Approximately when animatedProgress is between 0.05 - 0.1, composable recreates and animation starts from beginning. Maybe this happens because at that moment, animation from navigation finishes.

Example:

@Composable
fun TestProgress() {
    var progress by remember { mutableStateOf(0f) }
    val animatedProgress by animateFloatAsState(
        targetValue = progress, animationSpec = tween(durationMillis = 500, easing = LinearEasing)
    )

    LaunchedEffect(Unit) {
        progress = 1f
    }
    LinearProgressIndicator(
        progress = animatedProgress,
    )

}

KostadinAlmishev avatar Dec 24 '23 20:12 KostadinAlmishev

The root case of this might be #197, and can be fixed once we got compose-multiplatform 1.6.0

Tlaster avatar Dec 25 '23 03:12 Tlaster

It seems that the issue of screen freezing when quickly switching routes still persists in version 1.6.0-beta01, possibly due to animation-related issues.

Example:

LaunchedEffect(Unit){
                        coroutineScope.launch {
                            for (i in 0 until 10){
                                TOP_LEVEL_DESTINATIONS.forEach{item->
                                    println(i)
                                    navigator.navigate(item.route)
                                    delay(400) //500 will be ok in default animation
                                }
                            }
                        }
                    }

After 1-3 transitions, it will stop navigating and remain frozen indefinitely.

It appears that this problem has been addressed in version 1.6.0-beta02. Waiting for further updates.

StarsEnd33A2D17 avatar Feb 09 '24 13:02 StarsEnd33A2D17

It seems that the issue of screen freezing when quickly switching routes still persists in version 1.6.0-beta01, possibly due to animation-related issues.

Example:

LaunchedEffect(Unit){
                        coroutineScope.launch {
                            for (i in 0 until 10){
                                TOP_LEVEL_DESTINATIONS.forEach{item->
                                    println(i)
                                    navigator.navigate(item.route)
                                    delay(400) //500 will be ok in default animation
                                }
                            }
                        }
                    }

After 1-3 transitions, it will stop navigating and remain frozen indefinitely.

It appears that this problem has been addressed in version 1.6.0-beta02. Waiting for further updates.

I still have this issue, iOS only tho.

1.6.0-beta02

FunkyMuse avatar Feb 22 '24 22:02 FunkyMuse