0

when i am changing page it should have fading animation but it is not working.

I have check the same code in my other project written by other developer where he is using the state from viewmodel and it is working.

val selectedPage = remember { mutableStateOf(SignInOrSignUpIdentifier.WELCOME) }
    Surface(
        color = Color.White,
        modifier = Modifier.fillMaxSize()
    ) {

        Crossfade(
            targetState = selectedPage
        ) { state ->

            when (state.value) {
                SignInOrSignUpIdentifier.WELCOME -> WelcomePage(selectedPage, isTermsAnsConditionChecked, handler, signInSignUpGlobalHandler)
                SignInOrSignUpIdentifier.SIGN_UP -> SignUpUsingEmail(selectedPage, handler, signInSignUpGlobalHandler)
                SignInOrSignUpIdentifier.SIGN_IN -> LoginUsingEmail(selectedPage, handler, signInSignUpGlobalHandler)
                SignInOrSignUpIdentifier.EMAIL_SENT -> EmailSent(selectedPage, handler)
                SignInOrSignUpIdentifier.FORGOT_PASSWORD -> ResetPassword(selectedPage, handler, signInSignUpGlobalHandler)
            }

        }

        LoadingView(context = context, isVisible = isLoading)
    }

I am trying to get the fading animation whenever i change the page but the animation is not working.

Ajay Singh
  • 21
  • 4

0 Answers0