In CardView XML: android:animateLayoutChanges="true"
and also the following in the code:
((androidx.cardview.widget.CardView) findViewById(R.id.view)).getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING);
Check FastOutSlowInInterpolator