다이얼로그로띄울수있는지알아보기 → 상태바투명때문에
→상태바색상변경으로해결
private fun View.openButtonAnimation(@DimenRes dimenId: Int) {
animate()
.translationY(-resources.getDimension(dimenId))
.setListener(getAnimatorListenerAdapter(onAnimationStart = { isVisible = true }))
}
private fun View.hideButtonAnimation() {
animate()
.translationY(0f)
.setListener(getAnimatorListenerAdapter(onAnimationEnd = { isVisible = false }))
}
private fun getAnimatorListenerAdapter(
onAnimationStart: (() -> Unit)? = null,
onAnimationEnd: (() -> Unit)? = null
): AnimatorListenerAdapter {
return object : AnimatorListenerAdapter() {
override fun onAnimationStart(animation: Animator?) {
super.onAnimationStart(animation)
onAnimationStart?.invoke()
}
override fun onAnimationEnd(animation: Animator?) {
super.onAnimationEnd(animation)
onAnimationEnd?.invoke()
}
}
}
Kotlin
복사