Skip to content
heewon edited this page Jan 15, 2021 · 2 revisions

Splash


📱 구현 화면



로티 애니메이션이 끝난 후에 콜백을 실행하여 애니메이션이 끝나면 화면이 전환되도록 구현

SplashActivity.kt
private fun initSplashAnimation() {
        val animationView = binding.lottieanimationSplash
        animationView.setAnimation("momo_splash.json")
        animationView.playAnimation()

        animationView.addAnimatorListener(object: Animator.AnimatorListener {
            ...
            override fun onAnimationEnd(animation: Animator?) {
                val intent = Intent(this@SplashActivity, HomeActivity::class.java)
                startActivity(intent)
                finish()
           }

    }