Stylianos Gakis
12/14/2022, 3:56 PMdelayMillis
which makes this convenient. From what I understand this isn’t the case for the spring one since you want to maintain momentum from potential earlier animations or something like that, is this the case?
Now I’m thinking of doing something like
val animatableProgress = remember { Animatable(0f) }
LaunchedEffect(Unit) {
delay(300)
animatableProgress.animateTo(1f, spring())
}
// use animatableProgress
to use this exact thing, but I feel like I may be missing some API which makes this simpler for me.Stylianos Gakis
12/14/2022, 3:59 PMfadeIn()
for example, which takes in an animationSpec as to how to fade in.
fun fadeIn(
animationSpec: FiniteAnimationSpec<Float> = spring(stiffness = Spring.StiffnessMediumLow),
initialAlpha: Float = 0f
)
I’d like to be able to do something like (pseudocode) fadeIn(animationSpec = nothing(300.milliseconds) + spring())
or fadeIn(animationSpec = spring(initialDelay = 300.milliseconds))
or something like this.
Otherwise with my impl above I have to then avoid using the convenience of AnimatedVisibility
and have to animate the thing myself using the result of the animatableProgress
, which will be much more inconvenient in general.Albert Chang
12/14/2022, 4:01 PMStylianos Gakis
12/14/2022, 4:05 PMspring
since it feels better in my particular animation. But maybe I should try and imitate that fluidity with the right Easing provided to my tweenAlbert Chang
12/14/2022, 4:10 PMStylianos Gakis
12/14/2022, 4:13 PMtween
then and see how it goes, thank you 🙌Doris Liu
12/14/2022, 5:36 PMDoris Liu
12/14/2022, 5:44 PMStylianos Gakis
12/14/2022, 5:52 PM