How to increase the view height using Property Animations in Android?
ObjectAnimator a = ObjectAnimator.ofFloat(viewToIncreaseHeight, \"translationY\", -100)
Here is my code to animate scrolling an item to center of the screen inside a recycleView
// Scrolling with animation
val valueAnimator = ValueAnimator.ofInt(getWidth() / 2)
valueAnimator.duration = 250L
valueAnimator.addUpdateListener {
val animatedValue = valueAnimator.animatedValue as Int
(layoutManager as LinearLayoutManager).scrollToPositionWithOffset(itemToScroll, animatedValue)
}
valueAnimator.start()
// End of scrolling with animation
Note it is a bit similar to UIView.animate in Swift, but with more complication