Deep Patel
06/04/2024, 6:33 PMZach Klippenstein (he/him) [MOD]
06/04/2024, 6:48 PMNicholas Doglio
06/04/2024, 9:56 PMblakelee
06/15/2024, 5:27 PMDeep Patel
06/16/2024, 3:17 AMDeep Patel
06/16/2024, 7:08 AMblakelee
06/17/2024, 3:49 AMupdateTransition(targetState = screen)
.Crossfade(
contentKey = { targetState -> targetState::class }
) { targetState ->
WorkflowRendering(targetState, viewEnvironment)
}
It matters what key you use because if the key is the object itself then anytime that object changes you’ll see a crossfade, so instead I did the crossfade on the class type
For slides you’d probably want something like this
val slideBack = slideInHorizontally { -it } togetherWith
slideOutHorizontally(targetOffsetX = { it })
val slideForward = slideInHorizontally { it } togetherWith
slideOutHorizontally(targetOffsetX = { -it })
val transition = if (isBack) slideBack else slideForward
AnimatedContent(
targetState = screen,
contentKey = { targetState -> targetState::class },
transitionSpec = { transition }
) { targetState ->
WorkflowRendering(targetState, viewEnvironment)
}
Deep Patel
06/17/2024, 6:50 PMblakelee
06/17/2024, 6:51 PMDeep Patel
06/17/2024, 6:55 PMblakelee
06/17/2024, 7:25 PMfun Parcelable.toSnapshot()
in the core-android library here.
Since we don’t have Parcelable available to us in KMP we’d probably want some sort of adapter for the usuals like kotlinx-serialization and other libraries.Deep Patel
06/17/2024, 7:26 PMDeep Patel
06/19/2024, 11:27 PMmainNavWorkflow
that returns a navRendering
. There’s a tabBarRendering
as a parameter in that rendering. Is it an anti-pattern to create a new instance of tabBarRendering
and pass it navRendering
? Or do I have to make a call to the render child to the tabBarWorkflow
to get the tabBarRendering
and pass that into the navRendering
?
Both of these approaches work since I have a ScreenComposableFactory
registering both renderings. I’m just wondering if this is an anti pattern. (If you’re wondering, tabBarWorkflow
is stateless)blakelee
06/20/2024, 4:37 PMcontext.eventHandler { newTabBarRendering ->
state = state.copy(tabBarRendering = newTabBarRendering)
}