Above @ashakirov's answer works fine if you want to scale up and down while pressing(holding) the recylerview item, for those who want this zoom animation for click of an item can do these changes to make that work.
recyclerview_item.xml
<?xml version="1.0" encoding="utf-8"?>
<View xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/item_animal_height"
android:background="#f00"
android:stateListAnimator="@animator/list_animator"/>
res/animator/list_animator.xml (changed android:state_pressed to android:state_selected)
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true">
<set>
<objectAnimator android:propertyName="scaleX"
android:valueTo="1"/>
<objectAnimator android:propertyName="scaleY"
android:valueTo="1"/>
</set>
</item>
<item
android:state_selected="false">
<set>
<objectAnimator android:propertyName="scaleX"
android:valueTo="0.8"/>
<objectAnimator android:propertyName="scaleY"
android:valueTo="0.8"/>
</set>
</item>
</selector>
Now maintain a variable for the selected position update it onClick to the position of itemview and call notifyDataSetChanged() as it will trigger OnBindViewHolder where we will change the selected sate of the itemview.
//add this
holder.itemView.isSelected = position == selectedPosition
holder.itemView.setOnClickListener {
selectedPosition = position
notifyDataSetChanged()
}