I have two composables need to apply transition(sl...
# compose
a
I have two composables need to apply transition(slide In/Out) between them, I show/hide them as following:
Copy code
when (loginUiState) {
     is LoginEmailUiState ->
        LoginEmailPassContainer(loginUiState)
     is ResetPasswordUiState ->
        ResetPasswordContainer(loginUiState)
}
How I can achieve that?
o
AnimatedContent
This is the way mandalorian https://developer.android.com/jetpack/compose/animation#animatedcontent You could start with default:
Copy code
AnimatedContent(targetState = loginUiState) { state ->
   when (state) {
     is LoginEmailUiState ->
        LoginEmailPassContainer(state)
     is ResetPasswordUiState ->
        ResetPasswordContainer(state)
   }
}
And then tweak
transitionSpec
as needed, see docs above ☝️
y