Is there any way to "slow down" animation in compo...
# compose
c
Is there any way to "slow down" animation in compose? I'm trying to slow down my AnimatedVisibility composable with the 3 scale options available in dev options but none of them seem to affect it.
s
Not sure about the 3 scale options but you can add
durationMillis
to the
animationSpec
in transitions
Copy code
AnimatedVisibility(
                    enter = slideInHorizontally(
                        animationSpec = tween(durationMillis = 2000)
                    ),
                    exit = slideOutHorizontally(
                        animationSpec = tween(durationMillis = 2000)
                    )
                )
v
I think Colton specifically wants to know if it is possible to affect all animation durations from Developer Options as the standard Android animation framework does. Ofc you can make a complete duplicate of all animation APIs and wrap it setting 0 if some scale option is enabled. But it’d be much more convenient if this feature was available out of the box. So +1
👍 1
d
We have a feature request on this: https://issuetracker.google.com/161675988
2
c
If this is to test animations at slower speeds, you can try the animation inspector tool in Studio to slow it down
It’s under experimental settings, but helps slow things down without deploying to device