How to increase the view height using Property Animations in Android?
ObjectAnimator a = ObjectAnimator.ofFloat(viewToIncreaseHeight, \"translationY\", -100)
Use this method in kotlin:
private fun increaseViewSize(view: View) {
val valueAnimator = ValueAnimator.ofInt(view.measuredHeight, view.measuredHeight+20)
valueAnimator.duration = 500L
valueAnimator.addUpdateListener {
val animatedValue = valueAnimator.animatedValue as Int
val layoutParams = view.layoutParams
layoutParams.height = animatedValue
view.layoutParams = layoutParams
}
valueAnimator.start()
}