0

I have an AuthorizationActivity with 3 scenes, which are simply different number of fields, so when user comes on Activity runs first "splash scene", with 2 buttons(Sign In, Sign Up), by clicking on each user sees the same activity but different scenes. By clicking on Back button I change scene, for example if user on the Sign In, back click -> change scene to splash.

And now I have a problem, when he at first time went to Sign In, typing text(validation works,logic works, all is cool), then he decides go back, and go again to SignIn (logic is broken, validation doesn't work, things are bad)

Memory is growing, so I guess the problem is a multiple objects of scenes, because if I on SignIn and all fields filled correctly debug shows that my model is empty. I appreciate any help)

go SignUp

fun goSignUpTransition(v: View) {
        TransitionManager.beginDelayedTransition(rootContainer_AS, changeBounds)
        back.isClickable = true
        splashSceneFields.sceneRoot.visibility = View.GONE
        val layoutParams = innerArcContainer_SSM.layoutParams
        layoutParams.height = signUpHeaderHeight
        innerArcContainer_SSM.layoutParams = layoutParams

        val pp = localRoot.layoutParams as LinearLayout.LayoutParams
        pp.topMargin = signUpMargin

        this.signUpContainer.visibility = View.VISIBLE
        this.signUpContainer.animate().alpha(1f).start()
        this.wellaLogo_SA.visibility = View.GONE
        this.wellaLogo_SA.animate().alpha(0f).start()
        this.title_SSM.text = getString(R.string.sign_up_text)

        val alpha = this.toolbarControllers_SSM.animate().alpha(1f)
        alpha.duration = ANIM_DURATION
        alpha.start()

        TransitionManager.go(signUpScene)
        splashSceneFields.sceneRoot.visibility = View.VISIBLE

    }

go back

fun goSplashTransition(v: View) {
    galleryBottomSheet.photoURI = null
    userPhoto_SSM.setImageResource(R.drawable.ic_photo_upload_white_big)

    TransitionManager.beginDelayedTransition(rootContainer_AS, changeBounds)
    splashSceneFields.sceneRoot.visibility = View.GONE

    val layoutParams = innerArcContainer_SSM.layoutParams
    layoutParams.height = preAnimDimension
    innerArcContainer_SSM.layoutParams = layoutParams

    val pp = localRoot.layoutParams as LinearLayout.LayoutParams
    pp.topMargin = 0

    val animator = wellaLogo_SA.animate()
    animator.scaleX(1f).scaleY(1f).duration = ANIM_DURATION
    animator.start()

    val alpha = this.toolbarControllers_SSM.animate().alpha(0f)
    alpha.duration = ANIM_DURATION
    alpha.start()

    this.signUpContainer.animate().alpha(0f).start()
    this.signUpContainer.visibility = View.GONE
    this.wellaLogo_SA.visibility = View.VISIBLE
    this.wellaLogo_SA.animate().alpha(1f).start()


    TransitionManager.go(splashSceneFields)
    back.isClickable = false
    splashSceneFields.sceneRoot.visibility = View.VISIBLE
}
Dennis Zinkovski
  • 1,821
  • 3
  • 25
  • 42

1 Answers1

4

Found solution by myself, every time when scenes comes, I had to find all my views again, set listeners and so on. Scene has a setEnterAction where you'd like to bind UI or update your model(this I supposed to do) and setExitAction if you have something you have to release/clear/update, do it there.

Dennis Zinkovski
  • 1,821
  • 3
  • 25
  • 42