AmrJyniat
09/29/2021, 12:11 PMdarkmoon_uk
09/29/2021, 12:13 PMLaunchedEffect(key = null) {
// First time only stuff
}
AmrJyniat
09/29/2021, 12:24 PMModifier.offset {
//{Trigger code in the initial composition only}
IntOffset(offsetTransitionActions.roundToInt(), 0)
}
LaunchedEffect{}
need a composable scope which is not exists in offset lambda.darkmoon_uk
09/29/2021, 12:51 PMisFirstTime
flag? Composition is single threaded so it should be safe (for now).Felix Schütz
09/29/2021, 12:51 PMAmrJyniat
09/29/2021, 12:57 PMoffsetTransitionActions
to animate the offsite but it depends on another value that takes some mills to calculate.
so I want to set a value to the offset modifier while the calculation gets ready.Zach Klippenstein (he/him) [MOD]
09/29/2021, 4:21 PMZach Klippenstein (he/him) [MOD]
09/29/2021, 4:23 PMAmrJyniat
09/29/2021, 4:37 PMZach Klippenstein (he/him) [MOD]
09/29/2021, 4:47 PMAmrJyniat
09/30/2021, 9:11 AManimateFloat
like this:
val offsetTransitionCard by transition.animateFloat(
targetValueByState = { if (isRevealed) -rowWidth else 0f },
)
• Change the row's offset to 0 via animateFloat
like this:
val offsetTransitionRow by transitionActions.animateFloat(
targetValueByState = { if (isRevealed) 0f else rowWidth },
)
till now all good but we have one problem, when initial composition occurred the rowWidth
will be 0 because it's not calculated yet which means the Row offset will be 0 too which means again the Row will be showing for mills then will offset when the rowWidth
gets ready.
So I want a way to make the row's default offset to be like 500 instead of 0 on the initial compose only.AmrJyniat
09/30/2021, 9:22 AM