Created
February 20, 2021 14:09
-
-
Save kazufusa/e56c3f496d2c915872a0a9a98725a359 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun fadeIn(view: View) { | |
view.apply { | |
alpha = 0f | |
visibility = View.VISIBLE | |
animate() | |
.alpha(1f) | |
.setDuration(300) | |
.setListener(null) | |
} | |
} | |
private fun fadeOut(view: View) { | |
view.animate() | |
.alpha(0f) | |
.setDuration(300) | |
.setListener(object : AnimatorListenerAdapter() { | |
override fun onAnimationEnd(animation: Animator) { | |
view.visibility = View.INVISIBLE | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment